@lets-events/react 12.4.1 → 12.5.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 (91) hide show
  1. package/.eslintrc.json +2 -2
  2. package/CHANGELOG.md +6 -0
  3. package/package.json +1 -1
  4. package/src/components/Alert.tsx +303 -303
  5. package/src/components/Avatar.tsx +55 -55
  6. package/src/components/Badge.tsx +125 -125
  7. package/src/components/Box.tsx +3 -3
  8. package/src/components/Button/index.tsx +45 -45
  9. package/src/components/Button/styledComponents.ts +313 -313
  10. package/src/components/ButtonGroup.tsx +484 -484
  11. package/src/components/Calendar/index.tsx +148 -148
  12. package/src/components/Calendar/styledComponents.ts +259 -259
  13. package/src/components/Card.tsx +67 -67
  14. package/src/components/CheckboxGroup.tsx +176 -176
  15. package/src/components/Container.tsx +39 -39
  16. package/src/components/Divider.tsx +7 -7
  17. package/src/components/DoubleCalendar/index.tsx +170 -166
  18. package/src/components/Drawer/index.tsx +100 -98
  19. package/src/components/Drawer/styledComponents.ts +103 -103
  20. package/src/components/Dropdown.tsx +302 -302
  21. package/src/components/Filter.tsx +164 -164
  22. package/src/components/Flex.tsx +118 -118
  23. package/src/components/FormFields/AddressFormFields/CityFormField.tsx +111 -111
  24. package/src/components/FormFields/AddressFormFields/CountryFormField.tsx +33 -33
  25. package/src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx +39 -39
  26. package/src/components/FormFields/AddressFormFields/StateFormField.tsx +32 -32
  27. package/src/components/FormFields/AddressFormFields/index.tsx +141 -141
  28. package/src/components/FormFields/BirthDateFormField.tsx +84 -84
  29. package/src/components/FormFields/CNPJFormField.tsx +87 -87
  30. package/src/components/FormFields/CPFFormField.tsx +78 -78
  31. package/src/components/FormFields/CalendarFormField.tsx +95 -95
  32. package/src/components/FormFields/CheckboxGroupFormField.tsx +91 -91
  33. package/src/components/FormFields/DoubleCalendarFormField.tsx +93 -90
  34. package/src/components/FormFields/EmailFormField.tsx +27 -27
  35. package/src/components/FormFields/Form.tsx +39 -39
  36. package/src/components/FormFields/IdentityDocumentNumberFormField.tsx +32 -32
  37. package/src/components/FormFields/MultiSelectFormField.tsx +64 -64
  38. package/src/components/FormFields/PhoneFormField.tsx +40 -40
  39. package/src/components/FormFields/RadioGroupFormField.tsx +84 -84
  40. package/src/components/FormFields/RichEditorFormField.tsx +103 -103
  41. package/src/components/FormFields/SelectFormField.tsx +93 -93
  42. package/src/components/FormFields/SwitchFormField.tsx +46 -46
  43. package/src/components/FormFields/TextAreaFormField.tsx +59 -59
  44. package/src/components/FormFields/TextFormField.tsx +112 -112
  45. package/src/components/FormFields/TimePickerFormField.tsx +88 -88
  46. package/src/components/FormFields/subComponents/ErrorFormMessage.tsx +36 -36
  47. package/src/components/FormFields/subComponents/FormLabel.tsx +29 -29
  48. package/src/components/FormFields/utils/validation.ts +23 -23
  49. package/src/components/Grid.tsx +137 -137
  50. package/src/components/Icon.tsx +47 -47
  51. package/src/components/MenuDropdown/index.tsx +38 -38
  52. package/src/components/MenuDropdown/styledComponents.ts +31 -31
  53. package/src/components/Modal.tsx +110 -110
  54. package/src/components/MultiSelect/index.tsx +243 -243
  55. package/src/components/MultiSelect/styledComponents.ts +160 -160
  56. package/src/components/RadioGroup.tsx +210 -210
  57. package/src/components/RichEditor/QuillComponent.tsx +457 -457
  58. package/src/components/RichEditor/RichEditor.tsx +49 -49
  59. package/src/components/RichEditor/index.ts +2 -2
  60. package/src/components/RichEditor/styledComponents.ts +1151 -1151
  61. package/src/components/Section.tsx +33 -33
  62. package/src/components/Step.tsx +164 -164
  63. package/src/components/Switch.tsx +108 -108
  64. package/src/components/Text.tsx +38 -38
  65. package/src/components/TextField.tsx +372 -372
  66. package/src/components/TextareaField.tsx +138 -138
  67. package/src/components/TimePicker.tsx +328 -328
  68. package/src/components/Toast/components/ToastItem.tsx +41 -41
  69. package/src/components/Toast/components/ToastProvider.tsx +63 -63
  70. package/src/components/Toast/hooks/useToast.ts +12 -12
  71. package/src/components/Toast/index.tsx +5 -5
  72. package/src/components/Toast/styles/index.ts +135 -135
  73. package/src/components/Toast/types/index.ts +46 -46
  74. package/src/components/Tooltip/index.tsx +66 -66
  75. package/src/components/Tooltip/styles.ts +77 -77
  76. package/src/hooks/useCountries.ts +41 -41
  77. package/src/hooks/useImageUpload.ts +139 -139
  78. package/src/hooks/useOnClickOutside.tsx +42 -42
  79. package/src/index.tsx +71 -71
  80. package/src/styles/index.ts +41 -41
  81. package/src/types/typographyValues.ts +178 -178
  82. package/src/utils/getNestedValue.ts +3 -3
  83. package/src/utils/states.ts +29 -29
  84. package/src/utils/uploadService.ts +180 -180
  85. package/tsconfig.json +3 -3
  86. package/tsup.config.ts +38 -38
  87. package/.turbo/turbo-build.log +0 -19
  88. package/dist/index.d.mts +0 -15398
  89. package/dist/index.d.ts +0 -15398
  90. package/dist/index.js +0 -13390
  91. package/dist/index.mjs +0 -13284
@@ -1,485 +1,485 @@
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
- boxSizing: 'border-box',
12
- variants: {
13
- active: {
14
- true: {
15
- },
16
- }
17
- },
18
- });
19
-
20
- export const ButtonGroupStyled = styled(Flex, {
21
- display: 'flex',
22
- borderRadius: '$md',
23
- overflow: 'hidden',
24
- variants: {
25
- color: {
26
- brand: {},
27
- neutral: {},
28
- purple: {},
29
- green: {},
30
- blue: {},
31
- red: {},
32
- },
33
- variant: {
34
- text: {
35
- [`& ${ButtonItemStyled}`]: {
36
- backgroundColor: 'transparent',
37
- boxShadow: 'none',
38
- padding: 0,
39
- border: 0,
40
- },
41
- },
42
- contained: {
43
- [`& ${ButtonItemStyled}`]: {
44
- borderWidth: '1px',
45
- borderStyle: 'solid',
46
- '&:disabled': {
47
- boxShadow: 'none',
48
- }
49
- }
50
- },
51
- outlined: {
52
- [`& ${ButtonItemStyled}`]: {
53
- borderWidth: '1px',
54
- borderStyle: 'solid',
55
- '&:disabled': {
56
- color: '$neutral400',
57
- }
58
- }
59
- },
60
- },
61
- typography: {
62
- buttonLarge: {
63
- [`& ${ButtonItemStyled}`]: {
64
- padding: '$13 $20',
65
- fontSize: '$buttonLarge',
66
- lineHeight: '$buttonLarge',
67
- '&:not(:first-child)': {
68
- borderLeft: 'none',
69
- },
70
- '&:first-child': {
71
- borderTopLeftRadius: '$lg',
72
- borderBottomLeftRadius: '$lg',
73
- },
74
- '&:last-child': {
75
- borderTopRightRadius: '$lg',
76
- borderBottomRightRadius: '$lg',
77
- },
78
- }
79
- },
80
- buttonMedium: {
81
- [`& ${ButtonItemStyled}`]: {
82
- padding: '$12 $16',
83
- fontSize: '$buttonMedium',
84
- lineHeight: '$buttonMedium',
85
- '&:not(:first-child)': {
86
- borderLeft: 'none',
87
- },
88
- '&:first-child': {
89
- borderTopLeftRadius: '$md',
90
- borderBottomLeftRadius: '$md',
91
- },
92
- '&:last-child': {
93
- borderTopRightRadius: '$md',
94
- borderBottomRightRadius: '$md',
95
- },
96
- }
97
- },
98
- buttonSmall: {
99
- [`& ${ButtonItemStyled}`]: {
100
- padding: '$8 $14',
101
- fontSize: '$buttonSmall',
102
- lineHeight: '$buttonSmall',
103
- '&:not(:first-child)': {
104
- borderLeft: 'none',
105
- },
106
- '&:first-child': {
107
- borderTopLeftRadius: '$sm',
108
- borderBottomLeftRadius: '$sm',
109
- },
110
- '&:last-child': {
111
- borderTopRightRadius: '$sm',
112
- borderBottomRightRadius: '$sm',
113
- },
114
- }
115
- },
116
- buttonExtraSmall: {
117
- [`& ${ButtonItemStyled}`]: {
118
- padding: '$6 $12',
119
- fontSize: '$buttonExtraSmall',
120
- lineHeight: '$buttonExtraSmall',
121
- '&:not(:first-child)': {
122
- borderLeft: 'none',
123
- },
124
- '&:first-child': {
125
- borderTopLeftRadius: '$xs',
126
- borderBottomLeftRadius: '$xs',
127
- },
128
- '&:last-child': {
129
- borderTopRightRadius: '$xs',
130
- borderBottomRightRadius: '$xs',
131
- },
132
- }
133
- },
134
- },
135
- fontWeight: {
136
- regular: { [`& ${ButtonItemStyled}`]: { fontWeight: '$regular' } },
137
- medium: { [`& ${ButtonItemStyled}`]: { fontWeight: '$medium' } },
138
- semibold: { [`& ${ButtonItemStyled}`]: { fontWeight: '$semibold' } },
139
- bold: { [`& ${ButtonItemStyled}`]: { fontWeight: '$bold' } },
140
- },
141
- },
142
-
143
- compoundVariants: [
144
- // text
145
- {
146
- variant: 'text',
147
- color: 'brand',
148
- css: {
149
- [`& ${ButtonItemStyled}`]: {
150
- color: '$brand500',
151
- '&:hover': { color: '$brand600' },
152
- '&:focus': { color: '$brand700' },
153
- '&:active': { color: '$brand500' },
154
- '&:disabled': { color: '$dark400' },
155
- },
156
- [`& ${ButtonItemStyled}.active`]: {
157
- color: '$brand700',
158
- '&:hover': { color: '$brand700' },
159
- '&:focus': { color: '$brand700' },
160
- '&:active': { color: '$brand700' },
161
- },
162
- }
163
- },
164
- {
165
- variant: 'text',
166
- color: 'neutral',
167
- css: {
168
- [`& ${ButtonItemStyled}`]: {
169
- color: '$neutral600',
170
- '&:hover': { color: '$neutral700' },
171
- '&:focus': { color: '$neutral800' },
172
- '&:active': { color: '$neutral500' },
173
- '&:disabled': { color: '$dark400' },
174
- },
175
- [`& ${ButtonItemStyled}.active`]: {
176
- color: '$neutral800',
177
- '&:hover': { color: '$neutral800' },
178
- '&:focus': { color: '$neutral800' },
179
- '&:active': { color: '$neutral800' },
180
- },
181
- }
182
- },
183
- {
184
- variant: 'text',
185
- color: 'purple',
186
- css: {
187
- [`& ${ButtonItemStyled}`]: {
188
- color: '$purple500',
189
- '&:hover': { color: '$purple600' },
190
- '&:focus': { color: '$purple700' },
191
- '&:active': { color: '$purple500' },
192
- '&:disabled': { color: '$dark400' },
193
- },
194
- [`& ${ButtonItemStyled}.active`]: {
195
- color: '$purple700',
196
- '&:hover': { color: '$purple700' },
197
- '&:focus': { color: '$purple700' },
198
- '&:active': { color: '$purple700' },
199
- },
200
- }
201
- },
202
- {
203
- variant: 'text',
204
- color: 'green',
205
- css: {
206
- [`& ${ButtonItemStyled}`]: {
207
- color: '$green500',
208
- '&:hover': { color: '$green600' },
209
- '&:focus': { color: '$green700' },
210
- '&:active': { color: '$green500' },
211
- '&:disabled': { color: '$dark400' },
212
- },
213
- [`& ${ButtonItemStyled}.active`]: {
214
- color: '$green700',
215
- '&:hover': { color: '$green700' },
216
- '&:focus': { color: '$green700' },
217
- '&:active': { color: '$green700' },
218
- },
219
- }
220
- },
221
- {
222
- variant: 'text',
223
- color: 'blue',
224
- css: {
225
- [`& ${ButtonItemStyled}`]: {
226
- color: '$blue500',
227
- '&:hover': { color: '$blue600' },
228
- '&:focus': { color: '$blue700' },
229
- '&:active': { color: '$blue500' },
230
- '&:disabled': { color: '$dark400' },
231
- },
232
- [`& ${ButtonItemStyled}.active`]: {
233
- color: '$blue700',
234
- '&:hover': { color: '$blue700' },
235
- '&:focus': { color: '$blue700' },
236
- '&:active': { color: '$blue700' },
237
- },
238
- }
239
- },
240
- {
241
- variant: 'text',
242
- color: 'red',
243
- css: {
244
- [`& ${ButtonItemStyled}`]: {
245
- color: '$red500',
246
- '&:hover': { color: '$red600' },
247
- '&:focus': { color: '$red700' },
248
- '&:active': { color: '$red500' },
249
- '&:disabled': { color: '$dark400' },
250
- },
251
- [`& ${ButtonItemStyled}.active`]: {
252
- color: '$red700',
253
- '&:hover': { color: '$red700' },
254
- '&:focus': { color: '$red700' },
255
- '&:active': { color: '$red700' },
256
- },
257
- }
258
- },
259
-
260
- // contained
261
- {
262
- variant: 'contained',
263
- color: 'brand',
264
- css: {
265
- [`& ${ButtonItemStyled}`]: {
266
- color: '$grey50',
267
- backgroundColor: '$brand500',
268
- borderColor: '$brand500',
269
- '&:hover': {
270
- backgroundColor: '$blue600',
271
- },
272
- '&:focus': {
273
- backgroundColor: '$blue700',
274
- },
275
- '&:active': {
276
- backgroundColor: '$blue500',
277
- },
278
- '&:disabled': {
279
- backgroundColor: '$brand50',
280
- color: '$neutral400',
281
- }
282
- },
283
- [`& ${ButtonItemStyled}.active`]: {
284
- backgroundColor: '$brand700',
285
- '&:hover': { backgroundColor: '$brand700' },
286
- '&:focus': { backgroundColor: '$brand700' },
287
- '&:active': { backgroundColor: '$brand700' },
288
- },
289
- }
290
- },
291
- {
292
- variant: 'contained',
293
- color: 'neutral',
294
- css: {
295
- [`& ${ButtonItemStyled}`]: {
296
- backgroundColor: '$neutral600',
297
- color: '$grey50',
298
- '&:hover': {
299
- backgroundColor: '$neutral700',
300
- borderColor: '$neutral800',
301
- },
302
- '&:focus': {
303
- backgroundColor: '$neutral800',
304
- },
305
- '&:active': {
306
- backgroundColor: '$neutral500',
307
- borderColor: '$neutral400',
308
- },
309
- '&:disabled': {
310
- backgroundColor: '$neutral50',
311
- borderColor: '$neutral200',
312
- color: '$neutral400',
313
- }
314
- },
315
- [`& ${ButtonItemStyled}.active`]: {
316
- backgroundColor: '$neutral800',
317
- '&:hover': { backgroundColor: '$neutral800' },
318
- '&:focus': { backgroundColor: '$neutral800' },
319
- '&:active': { backgroundColor: '$neutral800' },
320
- },
321
- }
322
- },
323
- {
324
- variant: 'contained',
325
- color: 'purple',
326
- css: {
327
- [`& ${ButtonItemStyled}`]: {
328
- backgroundColor: '$purple500',
329
- color: '$grey50',
330
- '&:hover': {
331
- backgroundColor: '$purple600',
332
- borderColor: '$purple700',
333
- },
334
- '&:focus': {
335
- backgroundColor: '$purple700',
336
- },
337
- '&:active': {
338
- borderColor: '$purple300',
339
- backgroundColor: '$purple500',
340
- },
341
- '&:disabled': {
342
- borderColor: '$purple200',
343
- backgroundColor: '$purple200',
344
- color: '$neutral400',
345
- }
346
- },
347
- [`& ${ButtonItemStyled}.active`]: {
348
- backgroundColor: '$purple700',
349
- '&:hover': { backgroundColor: '$purple700' },
350
- '&:focus': { backgroundColor: '$purple700' },
351
- '&:active': { backgroundColor: '$purple700' },
352
- },
353
- }
354
- },
355
- // outlined
356
- {
357
- variant: 'outlined',
358
- color: 'brand',
359
- css: {
360
- [`& ${ButtonItemStyled}`]: {
361
- color: '$brand500',
362
- borderColor: '$brand300',
363
- backgroundColor: '$grey50',
364
- '&:hover': {
365
- borderColor: '$brand400',
366
- backgroundColor: '$brand50',
367
- },
368
- '&:focus': {
369
- borderColor: '$brand400',
370
- backgroundColor: '$brand50',
371
- },
372
- '&:active': {
373
- borderColor: '$brand300',
374
- backgroundColor: '$grey50',
375
- },
376
- '&:disabled': {
377
- borderColor: '$brand200',
378
- backgroundColor: '$neutral200',
379
- color: '$neutral400',
380
- }
381
- },
382
- [`& ${ButtonItemStyled}.active`]: {
383
- color: '$brand700',
384
- borderColor: '$brand600',
385
- backgroundColor: '$brand50',
386
- '&:hover': { backgroundColor: '$brand50', borderColor: '$brand600' },
387
- '&:focus': { backgroundColor: '$brand50', borderColor: '$brand600' },
388
- '&:active': { backgroundColor: '$brand50', borderColor: '$brand600' },
389
- },
390
- }
391
- },
392
- {
393
- variant: 'outlined',
394
- color: 'neutral',
395
- css: {
396
- [`& ${ButtonItemStyled}`]: {
397
- color: '$neutral600',
398
- borderColor: '$neutral300',
399
- backgroundColor: '$grey50',
400
- '&:hover': {
401
- borderColor: '$neutral400',
402
- backgroundColor: '$grey100',
403
- },
404
- '&:focus': {
405
- borderColor: '$neutral400',
406
- backgroundColor: '$grey100',
407
- },
408
- '&:active': {
409
- borderColor: '$neutral300',
410
- backgroundColor: '$grey50',
411
- },
412
- '&:disabled': {
413
- borderColor: '$neutral200',
414
- backgroundColor: '$neutral200',
415
- color: '$neutral400',
416
- }
417
- },
418
- [`& ${ButtonItemStyled}.active`]: {
419
- color: '$neutral800',
420
- borderColor: '$neutral600',
421
- backgroundColor: '$grey100',
422
- '&:hover': { backgroundColor: '$grey100', borderColor: '$neutral600' },
423
- '&:focus': { backgroundColor: '$grey100', borderColor: '$neutral600' },
424
- '&:active': { backgroundColor: '$grey100', borderColor: '$neutral600' },
425
- },
426
- }
427
- },
428
- {
429
- variant: 'outlined',
430
- color: 'purple',
431
- css: {
432
- [`& ${ButtonItemStyled}`]: {
433
- color: '$purple500',
434
- borderColor: '$purple300',
435
- backgroundColor: '$grey50',
436
- '&:hover': {
437
- borderColor: '$purple400',
438
- backgroundColor: '$purple50',
439
- },
440
- '&:focus': {
441
- borderColor: '$purple400',
442
- backgroundColor: '$purple50',
443
- },
444
- '&:active': {
445
- borderColor: '$purple300',
446
- backgroundColor: '$grey50',
447
- },
448
- '&:disabled': {
449
- borderColor: '$purple200',
450
- backgroundColor: '$neutral200',
451
- color: '$neutral400',
452
- }
453
- },
454
- [`& ${ButtonItemStyled}.active`]: {
455
- color: '$purple700',
456
- borderColor: '$purple600',
457
- backgroundColor: '$purple50',
458
- '&:hover': { backgroundColor: '$purple50', borderColor: '$purple600' },
459
- '&:focus': { backgroundColor: '$purple50', borderColor: '$purple600' },
460
- '&:active': { backgroundColor: '$purple50', borderColor: '$purple600' },
461
- },
462
- }
463
- },
464
-
465
- ],
466
-
467
- defaultVariants: {
468
- variant: 'contained',
469
- typography: 'buttonMedium',
470
- fontWeight: 'medium',
471
- color: 'brand',
472
- }
473
- });
474
-
475
- export interface ButtonItemProps extends ComponentProps<typeof ButtonItemStyled> { }
476
-
477
- export type ButtonGroupProps = ComponentProps<typeof ButtonGroupStyled>
478
-
479
- export function ButtonItem({ children, active, ...props }: ButtonItemProps) {
480
- return <ButtonItemStyled className={active ? 'active' : ''} {...props}>{children}</ButtonItemStyled>;
481
- }
482
-
483
- export function ButtonGroup({ children, ...props }: ButtonGroupProps) {
484
- return <ButtonGroupStyled {...props}>{children}</ButtonGroupStyled>;
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
+ boxSizing: 'border-box',
12
+ variants: {
13
+ active: {
14
+ true: {
15
+ },
16
+ }
17
+ },
18
+ });
19
+
20
+ export const ButtonGroupStyled = styled(Flex, {
21
+ display: 'flex',
22
+ borderRadius: '$md',
23
+ overflow: 'hidden',
24
+ variants: {
25
+ color: {
26
+ brand: {},
27
+ neutral: {},
28
+ purple: {},
29
+ green: {},
30
+ blue: {},
31
+ red: {},
32
+ },
33
+ variant: {
34
+ text: {
35
+ [`& ${ButtonItemStyled}`]: {
36
+ backgroundColor: 'transparent',
37
+ boxShadow: 'none',
38
+ padding: 0,
39
+ border: 0,
40
+ },
41
+ },
42
+ contained: {
43
+ [`& ${ButtonItemStyled}`]: {
44
+ borderWidth: '1px',
45
+ borderStyle: 'solid',
46
+ '&:disabled': {
47
+ boxShadow: 'none',
48
+ }
49
+ }
50
+ },
51
+ outlined: {
52
+ [`& ${ButtonItemStyled}`]: {
53
+ borderWidth: '1px',
54
+ borderStyle: 'solid',
55
+ '&:disabled': {
56
+ color: '$neutral400',
57
+ }
58
+ }
59
+ },
60
+ },
61
+ typography: {
62
+ buttonLarge: {
63
+ [`& ${ButtonItemStyled}`]: {
64
+ padding: '$13 $20',
65
+ fontSize: '$buttonLarge',
66
+ lineHeight: '$buttonLarge',
67
+ '&:not(:first-child)': {
68
+ borderLeft: 'none',
69
+ },
70
+ '&:first-child': {
71
+ borderTopLeftRadius: '$lg',
72
+ borderBottomLeftRadius: '$lg',
73
+ },
74
+ '&:last-child': {
75
+ borderTopRightRadius: '$lg',
76
+ borderBottomRightRadius: '$lg',
77
+ },
78
+ }
79
+ },
80
+ buttonMedium: {
81
+ [`& ${ButtonItemStyled}`]: {
82
+ padding: '$12 $16',
83
+ fontSize: '$buttonMedium',
84
+ lineHeight: '$buttonMedium',
85
+ '&:not(:first-child)': {
86
+ borderLeft: 'none',
87
+ },
88
+ '&:first-child': {
89
+ borderTopLeftRadius: '$md',
90
+ borderBottomLeftRadius: '$md',
91
+ },
92
+ '&:last-child': {
93
+ borderTopRightRadius: '$md',
94
+ borderBottomRightRadius: '$md',
95
+ },
96
+ }
97
+ },
98
+ buttonSmall: {
99
+ [`& ${ButtonItemStyled}`]: {
100
+ padding: '$8 $14',
101
+ fontSize: '$buttonSmall',
102
+ lineHeight: '$buttonSmall',
103
+ '&:not(:first-child)': {
104
+ borderLeft: 'none',
105
+ },
106
+ '&:first-child': {
107
+ borderTopLeftRadius: '$sm',
108
+ borderBottomLeftRadius: '$sm',
109
+ },
110
+ '&:last-child': {
111
+ borderTopRightRadius: '$sm',
112
+ borderBottomRightRadius: '$sm',
113
+ },
114
+ }
115
+ },
116
+ buttonExtraSmall: {
117
+ [`& ${ButtonItemStyled}`]: {
118
+ padding: '$6 $12',
119
+ fontSize: '$buttonExtraSmall',
120
+ lineHeight: '$buttonExtraSmall',
121
+ '&:not(:first-child)': {
122
+ borderLeft: 'none',
123
+ },
124
+ '&:first-child': {
125
+ borderTopLeftRadius: '$xs',
126
+ borderBottomLeftRadius: '$xs',
127
+ },
128
+ '&:last-child': {
129
+ borderTopRightRadius: '$xs',
130
+ borderBottomRightRadius: '$xs',
131
+ },
132
+ }
133
+ },
134
+ },
135
+ fontWeight: {
136
+ regular: { [`& ${ButtonItemStyled}`]: { fontWeight: '$regular' } },
137
+ medium: { [`& ${ButtonItemStyled}`]: { fontWeight: '$medium' } },
138
+ semibold: { [`& ${ButtonItemStyled}`]: { fontWeight: '$semibold' } },
139
+ bold: { [`& ${ButtonItemStyled}`]: { fontWeight: '$bold' } },
140
+ },
141
+ },
142
+
143
+ compoundVariants: [
144
+ // text
145
+ {
146
+ variant: 'text',
147
+ color: 'brand',
148
+ css: {
149
+ [`& ${ButtonItemStyled}`]: {
150
+ color: '$brand500',
151
+ '&:hover': { color: '$brand600' },
152
+ '&:focus': { color: '$brand700' },
153
+ '&:active': { color: '$brand500' },
154
+ '&:disabled': { color: '$dark400' },
155
+ },
156
+ [`& ${ButtonItemStyled}.active`]: {
157
+ color: '$brand700',
158
+ '&:hover': { color: '$brand700' },
159
+ '&:focus': { color: '$brand700' },
160
+ '&:active': { color: '$brand700' },
161
+ },
162
+ }
163
+ },
164
+ {
165
+ variant: 'text',
166
+ color: 'neutral',
167
+ css: {
168
+ [`& ${ButtonItemStyled}`]: {
169
+ color: '$neutral600',
170
+ '&:hover': { color: '$neutral700' },
171
+ '&:focus': { color: '$neutral800' },
172
+ '&:active': { color: '$neutral500' },
173
+ '&:disabled': { color: '$dark400' },
174
+ },
175
+ [`& ${ButtonItemStyled}.active`]: {
176
+ color: '$neutral800',
177
+ '&:hover': { color: '$neutral800' },
178
+ '&:focus': { color: '$neutral800' },
179
+ '&:active': { color: '$neutral800' },
180
+ },
181
+ }
182
+ },
183
+ {
184
+ variant: 'text',
185
+ color: 'purple',
186
+ css: {
187
+ [`& ${ButtonItemStyled}`]: {
188
+ color: '$purple500',
189
+ '&:hover': { color: '$purple600' },
190
+ '&:focus': { color: '$purple700' },
191
+ '&:active': { color: '$purple500' },
192
+ '&:disabled': { color: '$dark400' },
193
+ },
194
+ [`& ${ButtonItemStyled}.active`]: {
195
+ color: '$purple700',
196
+ '&:hover': { color: '$purple700' },
197
+ '&:focus': { color: '$purple700' },
198
+ '&:active': { color: '$purple700' },
199
+ },
200
+ }
201
+ },
202
+ {
203
+ variant: 'text',
204
+ color: 'green',
205
+ css: {
206
+ [`& ${ButtonItemStyled}`]: {
207
+ color: '$green500',
208
+ '&:hover': { color: '$green600' },
209
+ '&:focus': { color: '$green700' },
210
+ '&:active': { color: '$green500' },
211
+ '&:disabled': { color: '$dark400' },
212
+ },
213
+ [`& ${ButtonItemStyled}.active`]: {
214
+ color: '$green700',
215
+ '&:hover': { color: '$green700' },
216
+ '&:focus': { color: '$green700' },
217
+ '&:active': { color: '$green700' },
218
+ },
219
+ }
220
+ },
221
+ {
222
+ variant: 'text',
223
+ color: 'blue',
224
+ css: {
225
+ [`& ${ButtonItemStyled}`]: {
226
+ color: '$blue500',
227
+ '&:hover': { color: '$blue600' },
228
+ '&:focus': { color: '$blue700' },
229
+ '&:active': { color: '$blue500' },
230
+ '&:disabled': { color: '$dark400' },
231
+ },
232
+ [`& ${ButtonItemStyled}.active`]: {
233
+ color: '$blue700',
234
+ '&:hover': { color: '$blue700' },
235
+ '&:focus': { color: '$blue700' },
236
+ '&:active': { color: '$blue700' },
237
+ },
238
+ }
239
+ },
240
+ {
241
+ variant: 'text',
242
+ color: 'red',
243
+ css: {
244
+ [`& ${ButtonItemStyled}`]: {
245
+ color: '$red500',
246
+ '&:hover': { color: '$red600' },
247
+ '&:focus': { color: '$red700' },
248
+ '&:active': { color: '$red500' },
249
+ '&:disabled': { color: '$dark400' },
250
+ },
251
+ [`& ${ButtonItemStyled}.active`]: {
252
+ color: '$red700',
253
+ '&:hover': { color: '$red700' },
254
+ '&:focus': { color: '$red700' },
255
+ '&:active': { color: '$red700' },
256
+ },
257
+ }
258
+ },
259
+
260
+ // contained
261
+ {
262
+ variant: 'contained',
263
+ color: 'brand',
264
+ css: {
265
+ [`& ${ButtonItemStyled}`]: {
266
+ color: '$grey50',
267
+ backgroundColor: '$brand500',
268
+ borderColor: '$brand500',
269
+ '&:hover': {
270
+ backgroundColor: '$blue600',
271
+ },
272
+ '&:focus': {
273
+ backgroundColor: '$blue700',
274
+ },
275
+ '&:active': {
276
+ backgroundColor: '$blue500',
277
+ },
278
+ '&:disabled': {
279
+ backgroundColor: '$brand50',
280
+ color: '$neutral400',
281
+ }
282
+ },
283
+ [`& ${ButtonItemStyled}.active`]: {
284
+ backgroundColor: '$brand700',
285
+ '&:hover': { backgroundColor: '$brand700' },
286
+ '&:focus': { backgroundColor: '$brand700' },
287
+ '&:active': { backgroundColor: '$brand700' },
288
+ },
289
+ }
290
+ },
291
+ {
292
+ variant: 'contained',
293
+ color: 'neutral',
294
+ css: {
295
+ [`& ${ButtonItemStyled}`]: {
296
+ backgroundColor: '$neutral600',
297
+ color: '$grey50',
298
+ '&:hover': {
299
+ backgroundColor: '$neutral700',
300
+ borderColor: '$neutral800',
301
+ },
302
+ '&:focus': {
303
+ backgroundColor: '$neutral800',
304
+ },
305
+ '&:active': {
306
+ backgroundColor: '$neutral500',
307
+ borderColor: '$neutral400',
308
+ },
309
+ '&:disabled': {
310
+ backgroundColor: '$neutral50',
311
+ borderColor: '$neutral200',
312
+ color: '$neutral400',
313
+ }
314
+ },
315
+ [`& ${ButtonItemStyled}.active`]: {
316
+ backgroundColor: '$neutral800',
317
+ '&:hover': { backgroundColor: '$neutral800' },
318
+ '&:focus': { backgroundColor: '$neutral800' },
319
+ '&:active': { backgroundColor: '$neutral800' },
320
+ },
321
+ }
322
+ },
323
+ {
324
+ variant: 'contained',
325
+ color: 'purple',
326
+ css: {
327
+ [`& ${ButtonItemStyled}`]: {
328
+ backgroundColor: '$purple500',
329
+ color: '$grey50',
330
+ '&:hover': {
331
+ backgroundColor: '$purple600',
332
+ borderColor: '$purple700',
333
+ },
334
+ '&:focus': {
335
+ backgroundColor: '$purple700',
336
+ },
337
+ '&:active': {
338
+ borderColor: '$purple300',
339
+ backgroundColor: '$purple500',
340
+ },
341
+ '&:disabled': {
342
+ borderColor: '$purple200',
343
+ backgroundColor: '$purple200',
344
+ color: '$neutral400',
345
+ }
346
+ },
347
+ [`& ${ButtonItemStyled}.active`]: {
348
+ backgroundColor: '$purple700',
349
+ '&:hover': { backgroundColor: '$purple700' },
350
+ '&:focus': { backgroundColor: '$purple700' },
351
+ '&:active': { backgroundColor: '$purple700' },
352
+ },
353
+ }
354
+ },
355
+ // outlined
356
+ {
357
+ variant: 'outlined',
358
+ color: 'brand',
359
+ css: {
360
+ [`& ${ButtonItemStyled}`]: {
361
+ color: '$brand500',
362
+ borderColor: '$brand300',
363
+ backgroundColor: '$grey50',
364
+ '&:hover': {
365
+ borderColor: '$brand400',
366
+ backgroundColor: '$brand50',
367
+ },
368
+ '&:focus': {
369
+ borderColor: '$brand400',
370
+ backgroundColor: '$brand50',
371
+ },
372
+ '&:active': {
373
+ borderColor: '$brand300',
374
+ backgroundColor: '$grey50',
375
+ },
376
+ '&:disabled': {
377
+ borderColor: '$brand200',
378
+ backgroundColor: '$neutral200',
379
+ color: '$neutral400',
380
+ }
381
+ },
382
+ [`& ${ButtonItemStyled}.active`]: {
383
+ color: '$brand700',
384
+ borderColor: '$brand600',
385
+ backgroundColor: '$brand50',
386
+ '&:hover': { backgroundColor: '$brand50', borderColor: '$brand600' },
387
+ '&:focus': { backgroundColor: '$brand50', borderColor: '$brand600' },
388
+ '&:active': { backgroundColor: '$brand50', borderColor: '$brand600' },
389
+ },
390
+ }
391
+ },
392
+ {
393
+ variant: 'outlined',
394
+ color: 'neutral',
395
+ css: {
396
+ [`& ${ButtonItemStyled}`]: {
397
+ color: '$neutral600',
398
+ borderColor: '$neutral300',
399
+ backgroundColor: '$grey50',
400
+ '&:hover': {
401
+ borderColor: '$neutral400',
402
+ backgroundColor: '$grey100',
403
+ },
404
+ '&:focus': {
405
+ borderColor: '$neutral400',
406
+ backgroundColor: '$grey100',
407
+ },
408
+ '&:active': {
409
+ borderColor: '$neutral300',
410
+ backgroundColor: '$grey50',
411
+ },
412
+ '&:disabled': {
413
+ borderColor: '$neutral200',
414
+ backgroundColor: '$neutral200',
415
+ color: '$neutral400',
416
+ }
417
+ },
418
+ [`& ${ButtonItemStyled}.active`]: {
419
+ color: '$neutral800',
420
+ borderColor: '$neutral600',
421
+ backgroundColor: '$grey100',
422
+ '&:hover': { backgroundColor: '$grey100', borderColor: '$neutral600' },
423
+ '&:focus': { backgroundColor: '$grey100', borderColor: '$neutral600' },
424
+ '&:active': { backgroundColor: '$grey100', borderColor: '$neutral600' },
425
+ },
426
+ }
427
+ },
428
+ {
429
+ variant: 'outlined',
430
+ color: 'purple',
431
+ css: {
432
+ [`& ${ButtonItemStyled}`]: {
433
+ color: '$purple500',
434
+ borderColor: '$purple300',
435
+ backgroundColor: '$grey50',
436
+ '&:hover': {
437
+ borderColor: '$purple400',
438
+ backgroundColor: '$purple50',
439
+ },
440
+ '&:focus': {
441
+ borderColor: '$purple400',
442
+ backgroundColor: '$purple50',
443
+ },
444
+ '&:active': {
445
+ borderColor: '$purple300',
446
+ backgroundColor: '$grey50',
447
+ },
448
+ '&:disabled': {
449
+ borderColor: '$purple200',
450
+ backgroundColor: '$neutral200',
451
+ color: '$neutral400',
452
+ }
453
+ },
454
+ [`& ${ButtonItemStyled}.active`]: {
455
+ color: '$purple700',
456
+ borderColor: '$purple600',
457
+ backgroundColor: '$purple50',
458
+ '&:hover': { backgroundColor: '$purple50', borderColor: '$purple600' },
459
+ '&:focus': { backgroundColor: '$purple50', borderColor: '$purple600' },
460
+ '&:active': { backgroundColor: '$purple50', borderColor: '$purple600' },
461
+ },
462
+ }
463
+ },
464
+
465
+ ],
466
+
467
+ defaultVariants: {
468
+ variant: 'contained',
469
+ typography: 'buttonMedium',
470
+ fontWeight: 'medium',
471
+ color: 'brand',
472
+ }
473
+ });
474
+
475
+ export interface ButtonItemProps extends ComponentProps<typeof ButtonItemStyled> { }
476
+
477
+ export type ButtonGroupProps = ComponentProps<typeof ButtonGroupStyled>
478
+
479
+ export function ButtonItem({ children, active, ...props }: ButtonItemProps) {
480
+ return <ButtonItemStyled className={active ? 'active' : ''} {...props}>{children}</ButtonItemStyled>;
481
+ }
482
+
483
+ export function ButtonGroup({ children, ...props }: ButtonGroupProps) {
484
+ return <ButtonGroupStyled {...props}>{children}</ButtonGroupStyled>;
485
485
  }