@lets-events/react 5.0.0 → 6.1.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 (37) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +20 -18
  3. package/CHANGELOG.md +14 -1
  4. package/dist/index.d.mts +1916 -12
  5. package/dist/index.d.ts +1916 -12
  6. package/dist/index.js +5129 -348
  7. package/dist/index.mjs +5083 -307
  8. package/package.json +3 -2
  9. package/src/components/Alert.tsx +255 -255
  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/index.tsx +13 -0
  14. package/src/components/Button/styledComponents.ts +359 -0
  15. package/src/components/ButtonGroup.tsx +484 -477
  16. package/src/components/Calendar/index.tsx +122 -0
  17. package/src/components/Calendar/styledComponents.ts +195 -0
  18. package/src/components/CheckboxGroup.tsx +214 -208
  19. package/src/components/Container.tsx +39 -39
  20. package/src/components/Dropdown.tsx +167 -109
  21. package/src/components/Filter.tsx +164 -95
  22. package/src/components/Flex.tsx +117 -117
  23. package/src/components/Grid.tsx +137 -137
  24. package/src/components/Icon.tsx +47 -47
  25. package/src/components/Modal.tsx +108 -108
  26. package/src/components/RadioGroup.tsx +210 -203
  27. package/src/components/Section.tsx +33 -33
  28. package/src/components/Step.tsx +147 -147
  29. package/src/components/Switch.tsx +108 -108
  30. package/src/components/Text.tsx +31 -31
  31. package/src/components/TextField.tsx +261 -193
  32. package/src/components/TimePicker.tsx +125 -0
  33. package/src/index.tsx +29 -27
  34. package/src/styles/index.ts +38 -38
  35. package/src/types/typographyValues.ts +179 -0
  36. package/tsconfig.json +3 -3
  37. package/src/components/Button.tsx +0 -343
@@ -1,38 +1,38 @@
1
- import {
2
- colors,
3
- fontSizes,
4
- fontWeights,
5
- fonts,
6
- lineHeights,
7
- radii,
8
- space,
9
- } from '@lets-events/tokens'
10
-
11
- import { createStitches, defaultThemeMap } from '@stitches/react'
12
-
13
- export const {
14
- styled,
15
- css,
16
- globalCss,
17
- keyframes,
18
- getCssText,
19
- theme,
20
- createTheme,
21
- config,
22
- } = createStitches({
23
- themeMap: {
24
- ...defaultThemeMap,
25
- height: 'space',
26
- width: 'space',
27
- gap: 'space'
28
- },
29
- theme: {
30
- colors,
31
- fontSizes,
32
- fonts,
33
- fontWeights,
34
- lineHeights,
35
- radii,
36
- space,
37
- },
38
- })
1
+ import {
2
+ colors,
3
+ fontSizes,
4
+ fontWeights,
5
+ fonts,
6
+ lineHeights,
7
+ radii,
8
+ space,
9
+ } from '@lets-events/tokens'
10
+
11
+ import { createStitches, defaultThemeMap } from '@stitches/react'
12
+
13
+ export const {
14
+ styled,
15
+ css,
16
+ globalCss,
17
+ keyframes,
18
+ getCssText,
19
+ theme,
20
+ createTheme,
21
+ config,
22
+ } = createStitches({
23
+ themeMap: {
24
+ ...defaultThemeMap,
25
+ height: 'space',
26
+ width: 'space',
27
+ gap: 'space'
28
+ },
29
+ theme: {
30
+ colors,
31
+ fontSizes,
32
+ fonts,
33
+ fontWeights,
34
+ lineHeights,
35
+ radii,
36
+ space,
37
+ },
38
+ })
@@ -0,0 +1,179 @@
1
+ export const typographyValues = {
2
+ displayLarge: {
3
+ fontSize: '$displayLarge',
4
+ lineHeight: '$displayLarge',
5
+ letterSpacing: '$displayLarge',
6
+
7
+ },
8
+ displayMedium: {
9
+ fontSize: '$displayMedium',
10
+ lineHeight: '$displayMedium',
11
+ letterSpacing: '$displayMedium',
12
+ },
13
+ displaySmall: {
14
+ fontSize: '$displaySmall',
15
+ lineHeight: '$displaySmall',
16
+ letterSpacing: '$displaySmall',
17
+ },
18
+ headline1: {
19
+ fontSize: '$headline1',
20
+ lineHeight: '$headline1',
21
+ },
22
+ headline2: {
23
+ fontSize: '$headline2',
24
+ lineHeight: '$headline2',
25
+ },
26
+ headline3: {
27
+ fontSize: '$headline3',
28
+ lineHeight: '$headline3',
29
+ },
30
+ headline4: {
31
+ fontSize: '$headline4',
32
+ lineHeight: '$headline4',
33
+ },
34
+ headline5: {
35
+ fontSize: '$headline5',
36
+ lineHeight: '$headline5',
37
+ },
38
+ headline6: {
39
+ fontSize: '$headline6',
40
+ lineHeight: '$headline6',
41
+ },
42
+ headline7: {
43
+ fontSize: '$headline7',
44
+ lineHeight: '$headline7',
45
+ },
46
+ headline8: {
47
+ fontSize: '$headline8',
48
+ lineHeight: '$headline8',
49
+ },
50
+ bodyXL: {
51
+ fontSize: '$bodyXL',
52
+ lineHeight: '$bodyXL',
53
+ },
54
+ bodyL: {
55
+ fontSize: '$bodyL',
56
+ lineHeight: '$bodyL',
57
+ },
58
+ bodyM: {
59
+ fontSize: '$bodyM',
60
+ lineHeight: '$bodyM',
61
+ },
62
+ bodyS: {
63
+ fontSize: '$bodyS',
64
+ lineHeight: '$bodyS',
65
+ },
66
+ bodyXS: {
67
+ fontSize: '$bodyXS',
68
+ lineHeight: '$bodyXS',
69
+ },
70
+ bodyXXS: {
71
+ fontSize: '$bodyXXS',
72
+ lineHeight: '$bodyXXS',
73
+ },
74
+ badgeLarge: {
75
+ fontSize: '$badgeLarge',
76
+ lineHeight: '$badgeLarge',
77
+ },
78
+ badgeMedium: {
79
+ fontSize: '$badgeMedium',
80
+ lineHeight: '$badgeMedium',
81
+ },
82
+ badgeSmall: {
83
+ fontSize: '$badgeSmall',
84
+ lineHeight: '$badgeSmall',
85
+ },
86
+ badgeExtraSmall: {
87
+ fontSize: '$badgeExtraSmall',
88
+ lineHeight: '$badgeExtraSmall',
89
+ },
90
+ tooltip: {
91
+ fontSize: '$tooltip',
92
+ lineHeight: '$tooltip',
93
+ },
94
+ popoversRegular: {
95
+ fontSize: '$popoversRegular',
96
+ lineHeight: '$popoversRegular',
97
+ },
98
+ captionLarge: {
99
+ fontSize: '$captionLarge',
100
+ lineHeight: '$captionLarge',
101
+ },
102
+ captionMedium: {
103
+ fontSize: '$captionMedium',
104
+ lineHeight: '$captionMedium',
105
+ },
106
+ captionSmall: {
107
+ fontSize: '$captionSmall',
108
+ lineHeight: '$captionSmall',
109
+ },
110
+ buttonLarge: {
111
+ fontSize: '$buttonLarge',
112
+ lineHeight: '$buttonLarge',
113
+ },
114
+ buttonMedium: {
115
+ fontSize: '$buttonMedium',
116
+ lineHeight: '$buttonMedium',
117
+ },
118
+ buttonSmall: {
119
+ fontSize: '$buttonSmall',
120
+ lineHeight: '$buttonSmall',
121
+ },
122
+ buttonExtraSmall: {
123
+ fontSize: '$buttonExtraSmall',
124
+ lineHeight: '$buttonExtraSmall',
125
+ },
126
+ labelLarge: {
127
+ fontSize: '$labelLarge',
128
+ lineHeight: '$labelLarge',
129
+ },
130
+ labelMedium: {
131
+ fontSize: '$labelMedium',
132
+ lineHeight: '$labelMedium',
133
+ },
134
+ labelSmall: {
135
+ fontSize: '$labelSmall',
136
+ lineHeight: '$labelSmall',
137
+ },
138
+ labelExtraSmall: {
139
+ fontSize: '$labelExtraSmall',
140
+ lineHeight: '$labelExtraSmall',
141
+ },
142
+
143
+ }
144
+ export const typographyButtonValues = {
145
+ buttonLarge: {
146
+ fontSize: '$buttonLarge',
147
+ lineHeight: '$buttonLarge',
148
+ },
149
+ buttonMedium: {
150
+ fontSize: '$buttonMedium',
151
+ lineHeight: '$buttonMedium',
152
+ },
153
+ buttonSmall: {
154
+ fontSize: '$buttonSmall',
155
+ lineHeight: '$buttonSmall',
156
+ },
157
+ buttonExtraSmall: {
158
+ fontSize: '$buttonExtraSmall',
159
+ lineHeight: '$buttonExtraSmall',
160
+ },
161
+ }
162
+ export const typographyLabelValues = {
163
+ labelLarge: {
164
+ fontSize: '$labelLarge',
165
+ lineHeight: '$labelLarge',
166
+ },
167
+ labelMedium: {
168
+ fontSize: '$labelMedium',
169
+ lineHeight: '$labelMedium',
170
+ },
171
+ labelSmall: {
172
+ fontSize: '$labelSmall',
173
+ lineHeight: '$labelSmall',
174
+ },
175
+ labelExtraSmall: {
176
+ fontSize: '$labelExtraSmall',
177
+ lineHeight: '$labelExtraSmall',
178
+ },
179
+ }
package/tsconfig.json CHANGED
@@ -1,4 +1,4 @@
1
- {
2
- "extends": "@lets-events/ts-config/react.json",
3
- "include": ["src"]
1
+ {
2
+ "extends": "@lets-events/ts-config/react.json",
3
+ "include": ["src"]
4
4
  }
@@ -1,343 +0,0 @@
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
- '&:disabled': {
18
- cursor: 'not-allowed',
19
- transition: 'none',
20
- },
21
- variants: {
22
- color: {
23
- brand: {},
24
- neutral: {},
25
- purple: {},
26
- },
27
- variant: {
28
- text: {
29
- backgroundColor: 'transparent',
30
- boxShadow: 'none',
31
- padding: 0,
32
- border: 0,
33
- },
34
- contained: {
35
- '&:hover': {
36
- borderWidth: '$2',
37
- borderStyle: 'solid',
38
- },
39
- '&:focus': {
40
- border: 0,
41
- },
42
- '&:active': {
43
- borderWidth: '$4',
44
- borderStyle: 'solid',
45
- },
46
- '&:disabled': {
47
- borderWidth: '$1',
48
- borderStyle: 'solid',
49
- boxShadow: 'none',
50
- }
51
- },
52
- outlined: {
53
- borderWidth: '$1',
54
- borderStyle: 'solid',
55
- '&:hover': {
56
- borderWidth: '$2',
57
- borderStyle: 'solid',
58
- },
59
- '&:focus': {
60
- borderWidth: '$2',
61
- borderStyle: 'solid',
62
- },
63
- '&:active': {
64
- borderWidth: '$2',
65
- borderStyle: 'solid',
66
- },
67
- '&:disabled': {
68
- borderWidth: '$1',
69
- borderStyle: 'solid',
70
- color: '$neutral400',
71
- }
72
- }
73
- },
74
- size: {
75
- xs: {
76
- padding: '$6 $12',
77
- fontSize: '$12',
78
- lineHeight: '$base',
79
- },
80
- sm: {
81
- padding: '$8 $14',
82
- fontSize: '$13',
83
- lineHeight: '$smaller',
84
- },
85
- md: {
86
- padding: '$12 $16',
87
- fontSize: '$14',
88
- lineHeight: '$smaller',
89
- },
90
- lg: {
91
- padding: '$13 $20',
92
- fontSize: '$18',
93
- lineHeight: '$smaller',
94
- },
95
- },
96
- radii: {
97
- 'full': {
98
- borderRadius: '$full',
99
- }
100
- },
101
- },
102
-
103
- defaultVariants: {
104
- variant: 'contained',
105
- size: 'md',
106
- color: 'brand',
107
- },
108
-
109
- compoundVariants: [
110
- {
111
- variant: 'text',
112
- color: 'brand',
113
- css: {
114
- color: '$brand500',
115
- '&:hover': { color: '$brand600' },
116
- '&:focus': { color: '$brand700' },
117
- '&:active': { color: '$brand500' },
118
- '&:disabled': { color: '$dark400' },
119
- }
120
- },
121
- {
122
- variant: 'text',
123
- color: 'neutral',
124
- css: {
125
- color: '$neutral600',
126
- '&:hover': { color: '$neutral700' },
127
- '&:focus': { color: '$neutral800' },
128
- '&:active': { color: '$neutral500' },
129
- '&:disabled': { color: '$dark400' },
130
- }
131
- },
132
- {
133
- variant: 'text',
134
- color: 'purple',
135
- css: {
136
- color: '$purple500',
137
- '&:hover': { color: '$purple600' },
138
- '&:focus': { color: '$purple700' },
139
- '&:active': { color: '$purple500' },
140
- '&:disabled': { color: '$dark400' },
141
- }
142
- },
143
- {
144
- variant: 'text',
145
- color: 'green',
146
- css: {
147
- color: '$green500',
148
- '&:hover': { color: '$green600' },
149
- '&:focus': { color: '$green700' },
150
- '&:active': { color: '$green500' },
151
- '&:disabled': { color: '$dark400' },
152
- }
153
- },
154
- {
155
- variant: 'text',
156
- color: 'blue',
157
- css: {
158
- color: '$blue500',
159
- '&:hover': { color: '$blue600' },
160
- '&:focus': { color: '$blue700' },
161
- '&:active': { color: '$blue500' },
162
- '&:disabled': { color: '$dark400' },
163
- }
164
- },
165
- {
166
- variant: 'text',
167
- color: 'red',
168
- css: {
169
- color: '$red500',
170
- '&:hover': { color: '$red600' },
171
- '&:focus': { color: '$red700' },
172
- '&:active': { color: '$red500' },
173
- '&:disabled': { color: '$dark400' },
174
- }
175
- },
176
-
177
- // contained
178
- {
179
- variant: 'contained',
180
- color: 'brand',
181
- css: {
182
- color: '$grey50',
183
- backgroundColor: '$brand500',
184
- borderWidth: '$2',
185
- borderStyle: 'solid',
186
- borderColor: 'transparent',
187
- '&:hover': {
188
- borderColor: '$brand700',
189
- backgroundColor: '$blue600',
190
- },
191
- '&:focus': {
192
- backgroundColor: '$blue700',
193
- },
194
- '&:active': {
195
- borderColor: '$brand300',
196
- backgroundColor: '$blue500',
197
- },
198
- '&:disabled': {
199
- borderColor: '$brand50',
200
- backgroundColor: '$brand50',
201
- color: '$neutral400',
202
- }
203
- }
204
- },
205
- {
206
- variant: 'contained',
207
- color: 'neutral',
208
- css: {
209
- backgroundColor: '$neutral600',
210
- color: '$grey50',
211
- '&:hover': {
212
- backgroundColor: '$neutral700',
213
- borderColor: '$neutral800',
214
- },
215
- '&:focus': {
216
- backgroundColor: '$neutral800',
217
- },
218
- '&:active': {
219
- backgroundColor: '$neutral500',
220
- borderColor: '$neutral400',
221
- },
222
- '&:disabled': {
223
- backgroundColor: '$neutral50',
224
- borderColor: '$neutral200',
225
- color: '$neutral400',
226
- }
227
- }
228
- },
229
- {
230
- variant: 'contained',
231
- color: 'purple',
232
- css: {
233
- backgroundColor: '$purple500',
234
- color: '$grey50',
235
- '&:hover': {
236
- backgroundColor: '$purple600',
237
- borderColor: '$purple700',
238
- },
239
- '&:focus': {
240
- backgroundColor: '$purple700',
241
- },
242
- '&:active': {
243
- borderColor: '$purple300',
244
- backgroundColor: '$purple500',
245
- },
246
- '&:disabled': {
247
- borderColor: '$purple200',
248
- backgroundColor: '$purple200',
249
- color: '$neutral400',
250
- }
251
- }
252
- },
253
-
254
-
255
-
256
- // outlined
257
- {
258
- variant: 'outlined',
259
- color: 'brand',
260
- css: {
261
- color: '$brand500',
262
- borderColor: '$brand300',
263
- backgroundColor: '$grey50',
264
- '&:hover': {
265
- borderColor: '$brand400',
266
- backgroundColor: '$brand50',
267
- },
268
- '&:focus': {
269
- borderColor: '$brand400',
270
- backgroundColor: '$brand50',
271
- },
272
- '&:active': {
273
- borderColor: '$brand300',
274
- backgroundColor: '$grey50',
275
- },
276
- '&:disabled': {
277
- borderColor: '$brand200',
278
- backgroundColor: '$neutral200',
279
- }
280
- }
281
- },
282
- {
283
- variant: 'outlined',
284
- color: 'neutral',
285
- css: {
286
- color: '$neutral600',
287
- borderColor: '$neutral300',
288
- backgroundColor: '$grey50',
289
- '&:hover': {
290
- borderColor: '$neutral400',
291
- backgroundColor: '$grey100',
292
- },
293
- '&:focus': {
294
- borderColor: '$neutral400',
295
- backgroundColor: '$grey100',
296
- },
297
- '&:active': {
298
- borderColor: '$neutral300',
299
- backgroundColor: '$grey50',
300
- },
301
- '&:disabled': {
302
- borderColor: '$neutral200',
303
- backgroundColor: '$neutral200',
304
- }
305
- }
306
- },
307
- {
308
- variant: 'outlined',
309
- color: 'purple',
310
- css: {
311
- color: '$purple500',
312
- borderColor: '$purple300',
313
- backgroundColor: '$grey50',
314
- '&:hover': {
315
- borderColor: '$purple400',
316
- backgroundColor: '$purple50',
317
- },
318
- '&:focus': {
319
- borderColor: '$purple400',
320
- backgroundColor: '$purple50',
321
- },
322
- '&:active': {
323
- borderColor: '$purple300',
324
- backgroundColor: '$grey50',
325
- },
326
- '&:disabled': {
327
- borderColor: '$purple200',
328
- backgroundColor: '$neutral200',
329
- }
330
- }
331
- },
332
-
333
- ]
334
- })
335
-
336
- export interface ButtonProps extends ComponentProps<typeof ButtonStyled> {
337
- asChild?: boolean,
338
- }
339
-
340
- export function Button({ asChild, ...props }: ButtonProps) {
341
- const Component = asChild ? ButtonRadix : 'button'
342
- return <ButtonStyled as={Component} {...props} />
343
- }