@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,208 +1,214 @@
1
- import { ComponentProps } from 'react'
2
- import { styled } from '../styles'
3
- import { CheckboxGroup as CheckboxGroupRadix } from "@radix-ui/themes";
4
-
5
- export const CheckboxGroupStyled = styled(CheckboxGroupRadix.Root, {
6
- fontFamily: '$default',
7
- letterSpacing: '0px',
8
- fontSize: '$13',
9
- 'svg': {
10
- display: 'none'
11
- },
12
- 'label': {
13
- display: 'flex',
14
- alignItems: 'center',
15
- gap: '$8',
16
- cursor: 'pointer',
17
- '&:focus button, &:hover button': {
18
- transition: 'all 300ms ease-out',
19
- boxShadow: '0px 0px 0px 4px rgba(56, 129, 255, 0.50)'
20
- }
21
- },
22
- 'label button': {
23
- backgroundColor: '$white',
24
- borderRadius: '2px',
25
- height: '$16',
26
- width: '$16',
27
- position: 'relative',
28
- border: '2px solid $dark300',
29
- cursor: 'pointer',
30
- },
31
- 'label button[data-state=checked]:before': {
32
- backgroundColor: '$dark50',
33
- content: '',
34
- width: '8px',
35
- height: '8px',
36
- position: 'absolute',
37
- top: '2px',
38
- right: '2px',
39
- zIndex: 2,
40
- },
41
- 'label button[data-state=checked]:after': {
42
- backgroundColor: '$brand500',
43
- content: '',
44
- height: '$16',
45
- width: '$16',
46
- position: 'absolute',
47
- top: '-2px',
48
- right: '-2px',
49
- borderRadius: '2px',
50
- zIndex: 1,
51
- },
52
-
53
- variants: {
54
- color: {
55
- success: {
56
- 'label': {
57
- '&:focus button, &:hover button': {
58
- boxShadow: '0px 0px 0px 4px rgba(38, 167, 67, 0.50)',
59
- }
60
- },
61
- 'label button': {
62
- borderColor: '$green500',
63
- backgroundColor: '$dark50',
64
- },
65
- 'label button[data-state=checked]:after': {
66
- backgroundColor: '$green500',
67
- },
68
- },
69
- blue: {},
70
- error: {
71
- 'label': {
72
- '&:focus button, &:hover button': {
73
- boxShadow: '0px 0px 0px 4px rgba(225, 86, 98, 0.50)'
74
- }
75
- },
76
- 'label button': {
77
- borderColor: '$error400',
78
- backgroundColor: '$dark50',
79
- },
80
- 'label button[data-state=checked]:after': {
81
- backgroundColor: '$error600',
82
- },
83
- }
84
- },
85
- disabled: {
86
- true: {
87
- 'label': {
88
- cursor: 'not-allowed',
89
- opacity: 0.5,
90
- '&:focus button, &:hover button': {
91
- boxShadow: 'none',
92
- }
93
- },
94
- 'label button': {
95
- cursor: 'not-allowed',
96
- }
97
- },
98
- false: {}
99
- }
100
- },
101
-
102
- compoundVariants: [
103
-
104
- {
105
- color: 'blue',
106
- disabled: false,
107
- css: {
108
- 'label': {
109
- '&:focus button, &:hover button': {
110
- boxShadow: '0px 0px 0px 4px rgba(56, 129, 255, 0.50)'
111
- }
112
- },
113
- 'label button': {
114
- borderColor: '$dark300',
115
- },
116
- 'label button[data-state=checked]:after': {
117
- backgroundColor: '$brand500',
118
- },
119
- }
120
- },
121
-
122
- {
123
- color: 'blue',
124
- disabled: true,
125
- css: {
126
- 'label button': {
127
- borderColor: '$brand100',
128
- backgroundColor: '$dark50',
129
- },
130
- 'label button[data-state=checked]:after': {
131
- backgroundColor: '$brand100',
132
- },
133
- }
134
- },
135
-
136
- {
137
- color: 'success',
138
- disabled: true,
139
- css: {
140
- 'label button': {
141
- borderColor: '$success100',
142
- backgroundColor: '$dark50',
143
- },
144
- 'label button[data-state=checked]:after': {
145
- backgroundColor: '$success100',
146
- }
147
- }
148
- },
149
-
150
- {
151
- color: 'error',
152
- disabled: true,
153
- css: {
154
- 'label button': {
155
- borderColor: '$error100',
156
- backgroundColor: '$dark50',
157
- },
158
- 'label button[data-state=checked]:after': {
159
- backgroundColor: '$error100',
160
- }
161
- }
162
- }
163
- ],
164
- defaultVariants: {
165
- color: 'blue',
166
- disabled: false
167
- }
168
- })
169
-
170
- export type CheckboxGroupProps = ComponentProps<typeof CheckboxGroupStyled> & {
171
- placeholder?: string
172
- children?: React.ReactNode
173
- color?: string
174
- disabled?: boolean
175
- }
176
-
177
- export type CheckboxItemProps = {
178
- children?: React.ReactNode
179
- value: string,
180
- style?: React.CSSProperties
181
- }
182
-
183
- export function CheckboxGroup({
184
- children,
185
-
186
- ...props
187
- }: CheckboxGroupProps) {
188
- return (
189
- <CheckboxGroupStyled {...props}>
190
- {children}
191
- </CheckboxGroupStyled>
192
- )
193
- }
194
-
195
-
196
- export function CheckboxItem({
197
- children,
198
-
199
- ...props
200
- }: CheckboxItemProps) {
201
- return (
202
- <CheckboxGroupRadix.Item {...props}>
203
- {children}
204
- </CheckboxGroupRadix.Item>
205
- )
206
- }
207
-
208
-
1
+ import { ComponentProps } from 'react'
2
+ import { styled } from '../styles'
3
+ import { CheckboxGroup as CheckboxGroupRadix } from "@radix-ui/themes";
4
+ import { typographyLabelValues } from "../types/typographyValues";
5
+
6
+ export const CheckboxGroupStyled = styled(CheckboxGroupRadix.Root, {
7
+ fontFamily: '$default',
8
+ 'svg': {
9
+ display: 'none'
10
+ },
11
+ 'label': {
12
+ display: 'flex',
13
+ alignItems: 'center',
14
+ gap: '$8',
15
+ cursor: 'pointer',
16
+ '&:focus button, &:hover button': {
17
+ transition: 'all 300ms ease-out',
18
+ boxShadow: '0px 0px 0px 4px rgba(56, 129, 255, 0.50)'
19
+ }
20
+ },
21
+ 'label button': {
22
+ backgroundColor: '$white',
23
+ borderRadius: '2px',
24
+ height: '$16',
25
+ width: '$16',
26
+ position: 'relative',
27
+ border: '2px solid $dark300',
28
+ cursor: 'pointer',
29
+ },
30
+ 'label button[data-state=checked]:before': {
31
+ backgroundColor: '$dark50',
32
+ content: '',
33
+ width: '8px',
34
+ height: '8px',
35
+ position: 'absolute',
36
+ top: '2px',
37
+ right: '2px',
38
+ zIndex: 2,
39
+ },
40
+ 'label button[data-state=checked]:after': {
41
+ backgroundColor: '$brand500',
42
+ content: '',
43
+ height: '$16',
44
+ width: '$16',
45
+ position: 'absolute',
46
+ top: '-2px',
47
+ right: '-2px',
48
+ borderRadius: '2px',
49
+ zIndex: 1,
50
+ },
51
+
52
+ variants: {
53
+ color: {
54
+ success: {
55
+ 'label': {
56
+ '&:focus button, &:hover button': {
57
+ boxShadow: '0px 0px 0px 4px rgba(38, 167, 67, 0.50)',
58
+ }
59
+ },
60
+ 'label button': {
61
+ borderColor: '$green500',
62
+ backgroundColor: '$dark50',
63
+ },
64
+ 'label button[data-state=checked]:after': {
65
+ backgroundColor: '$green500',
66
+ },
67
+ },
68
+ blue: {},
69
+ error: {
70
+ 'label': {
71
+ '&:focus button, &:hover button': {
72
+ boxShadow: '0px 0px 0px 4px rgba(225, 86, 98, 0.50)'
73
+ }
74
+ },
75
+ 'label button': {
76
+ borderColor: '$error400',
77
+ backgroundColor: '$dark50',
78
+ },
79
+ 'label button[data-state=checked]:after': {
80
+ backgroundColor: '$error600',
81
+ },
82
+ }
83
+ },
84
+ disabled: {
85
+ true: {
86
+ 'label': {
87
+ cursor: 'not-allowed',
88
+ opacity: 0.5,
89
+ '&:focus button, &:hover button': {
90
+ boxShadow: 'none',
91
+ }
92
+ },
93
+ 'label button': {
94
+ cursor: 'not-allowed',
95
+ }
96
+ },
97
+ false: {}
98
+ },
99
+ typography: typographyLabelValues,
100
+ fontWeight: {
101
+ regular: { fontWeight: '$regular' },
102
+ medium: { fontWeight: '$medium' },
103
+ semibold: { fontWeight: '$semibold' },
104
+ bold: { fontWeight: '$bold' },
105
+ },
106
+ },
107
+
108
+ compoundVariants: [
109
+
110
+ {
111
+ color: 'blue',
112
+ disabled: false,
113
+ css: {
114
+ 'label': {
115
+ '&:focus button, &:hover button': {
116
+ boxShadow: '0px 0px 0px 4px rgba(56, 129, 255, 0.50)'
117
+ }
118
+ },
119
+ 'label button': {
120
+ borderColor: '$dark300',
121
+ },
122
+ 'label button[data-state=checked]:after': {
123
+ backgroundColor: '$brand500',
124
+ },
125
+ }
126
+ },
127
+
128
+ {
129
+ color: 'blue',
130
+ disabled: true,
131
+ css: {
132
+ 'label button': {
133
+ borderColor: '$brand100',
134
+ backgroundColor: '$dark50',
135
+ },
136
+ 'label button[data-state=checked]:after': {
137
+ backgroundColor: '$brand100',
138
+ },
139
+ }
140
+ },
141
+
142
+ {
143
+ color: 'success',
144
+ disabled: true,
145
+ css: {
146
+ 'label button': {
147
+ borderColor: '$success100',
148
+ backgroundColor: '$dark50',
149
+ },
150
+ 'label button[data-state=checked]:after': {
151
+ backgroundColor: '$success100',
152
+ }
153
+ }
154
+ },
155
+
156
+ {
157
+ color: 'error',
158
+ disabled: true,
159
+ css: {
160
+ 'label button': {
161
+ borderColor: '$error100',
162
+ backgroundColor: '$dark50',
163
+ },
164
+ 'label button[data-state=checked]:after': {
165
+ backgroundColor: '$error100',
166
+ }
167
+ }
168
+ }
169
+ ],
170
+ defaultVariants: {
171
+ color: 'blue',
172
+ disabled: false
173
+ }
174
+ })
175
+
176
+ export type CheckboxGroupProps = ComponentProps<typeof CheckboxGroupStyled> & {
177
+ placeholder?: string
178
+ children?: React.ReactNode
179
+ color?: string
180
+ disabled?: boolean
181
+ }
182
+
183
+ export type CheckboxItemProps = {
184
+ children?: React.ReactNode
185
+ value: string,
186
+ style?: React.CSSProperties
187
+ }
188
+
189
+ export function CheckboxGroup({
190
+ children,
191
+
192
+ ...props
193
+ }: CheckboxGroupProps) {
194
+ return (
195
+ <CheckboxGroupStyled {...props}>
196
+ {children}
197
+ </CheckboxGroupStyled>
198
+ )
199
+ }
200
+
201
+
202
+ export function CheckboxItem({
203
+ children,
204
+
205
+ ...props
206
+ }: CheckboxItemProps) {
207
+ return (
208
+ <CheckboxGroupRadix.Item {...props}>
209
+ {children}
210
+ </CheckboxGroupRadix.Item>
211
+ )
212
+ }
213
+
214
+
@@ -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
+ }