@lets-events/react 6.0.0 → 7.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.
@@ -1,329 +0,0 @@
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} />
329
- }