@lets-events/react 7.1.0 → 7.2.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "7.1.0",
3
+ "version": "7.2.1",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -1,129 +1,125 @@
1
-
2
- import { styled } from '../styles';
3
- import { Theme, AlertDialog } from '@radix-ui/themes';
4
- import { Button } from './Button';
5
- import { Flex } from './Flex';
6
- import Icon from './Icon';
7
- import { Text } from './Text';
8
-
1
+ import { styled } from "../styles";
2
+ import { Theme, AlertDialog } from "@radix-ui/themes";
3
+ import { Button } from "./Button";
4
+ import { Flex } from "./Flex";
5
+ import Icon from "./Icon";
6
+ import { Text } from "./Text";
9
7
 
10
8
  export const AlertDialogSimpleStyled = styled(AlertDialog.Content, {
11
- fontFamily: '$default',
12
- lineHeight: '$base',
13
- fontSize: '$13',
14
- padding: '$16',
15
- borderRadius: '$sm',
16
- display: 'flex',
17
- alignItems: 'center',
18
- justifyContent: 'space-between',
19
- gap: '$10',
20
- marginTop: '$10',
9
+ fontFamily: "$default",
10
+ lineHeight: "$base",
11
+ fontSize: "$13",
12
+ padding: "$16",
13
+ borderRadius: "$sm",
14
+ display: "flex",
15
+ alignItems: "center",
16
+ justifyContent: "space-between",
17
+ gap: "$10",
18
+ marginTop: "$10",
21
19
  variants: {
22
20
  color: {
23
21
  error: {
24
- backgroundColor: '$error50',
25
- border: '1px solid $error600',
26
- color: '$error600',
27
- 'svg': {
28
- color: '$error600',
29
- }
22
+ backgroundColor: "$error50",
23
+ border: "1px solid $error600",
24
+ color: "$error600",
25
+ svg: {
26
+ color: "$error600",
27
+ },
30
28
  },
31
29
  warning: {
32
- backgroundColor: '$warning50',
33
- border: '1px solid $warning600',
34
- color: '$warning600',
35
- 'svg': {
36
- color: '$warning600',
37
- }
30
+ backgroundColor: "$warning50",
31
+ border: "1px solid $warning600",
32
+ color: "$warning600",
33
+ svg: {
34
+ color: "$warning600",
35
+ },
38
36
  },
39
37
  success: {
40
- backgroundColor: '$success50',
41
- border: '1px solid $success600',
42
- color: '$success600',
43
- 'svg': {
44
- color: '$success600',
45
- }
38
+ backgroundColor: "$success50",
39
+ border: "1px solid $success600",
40
+ color: "$success600",
41
+ svg: {
42
+ color: "$success600",
43
+ },
46
44
  },
47
45
  info: {
48
- backgroundColor: '$info50',
49
- border: '1px solid $info600',
50
- color: '$info600',
51
- 'svg': {
52
- color: '$info600',
53
- }
46
+ backgroundColor: "$info50",
47
+ border: "1px solid $info600",
48
+ color: "$info600",
49
+ svg: {
50
+ color: "$info600",
51
+ },
54
52
  },
55
- }
53
+ },
56
54
  },
57
55
  defaultVariants: {
58
- color: 'success'
59
- }
60
- })
56
+ color: "success",
57
+ },
58
+ });
61
59
 
62
60
  export const AlertDialogCompleteStyled = styled(AlertDialog.Content, {
63
- fontFamily: '$default',
64
- lineHeight: '$base',
65
- fontSize: '$13',
66
- borderRadius: '$sm',
67
- marginTop: '$10',
68
- maxWidth: '440px',
69
- width: '100%',
70
- boxShadow: '0px 0px 15px 5px rgba(0, 0, 0, 0.05)',
71
- border: '1px solid $neutral200',
72
- '.le-alert-dialog-row': {
73
- display: 'flex',
74
- flexDirection: 'column',
75
- flexWrap: 'wrap',
76
- alignItems: 'center',
77
- textAlign: 'center',
78
- justifyContent: 'space-between',
79
- gap: '$10',
61
+ fontFamily: "$default",
62
+ lineHeight: "$base",
63
+ fontSize: "$13",
64
+ borderRadius: "$sm",
65
+ marginTop: "$10",
66
+ maxWidth: "440px",
67
+ width: "100%",
68
+ boxShadow: "0px 0px 15px 5px rgba(0, 0, 0, 0.05)",
69
+ border: "1px solid $neutral200",
70
+ ".le-alert-dialog-row": {
71
+ display: "flex",
72
+ flexDirection: "column",
73
+ flexWrap: "wrap",
74
+ alignItems: "center",
75
+ textAlign: "center",
76
+ justifyContent: "space-between",
77
+ gap: "$10",
80
78
  },
81
79
  variants: {
82
- color: {
83
- }
84
- }
85
- })
80
+ color: {},
81
+ },
82
+ });
86
83
 
87
84
  export const AlertDialogDescriptionStyled = styled(AlertDialog.Description, {
88
85
  padding: 0,
89
86
  margin: 0,
90
-
91
- })
87
+ });
92
88
 
93
89
  export const AlertDialogTitleStyled = styled(AlertDialog.Title, {
94
- fontFamily: '$default',
95
- lineHeight: '$base',
96
- fontSize: '$20',
97
- fontWeight: '$semibold',
90
+ fontFamily: "$default",
91
+ lineHeight: "$base",
92
+ fontSize: "$20",
93
+ fontWeight: "$semibold",
98
94
  padding: 0,
99
95
  margin: 0,
100
- })
96
+ });
101
97
 
102
98
  export const AlertDialogSubtitleStyled = styled(Text, {
103
99
  margin: 0,
104
- fontSize: '$48',
105
- color: '$gray100',
106
- fontWeight: '$semibold',
107
- })
100
+ fontSize: "$48",
101
+ color: "$gray100",
102
+ fontWeight: "$semibold",
103
+ });
108
104
 
109
- export const AlertDialogRowStyled = styled('div', {
110
- padding: '$32 $24',
111
- })
105
+ export const AlertDialogRowStyled = styled("div", {
106
+ padding: "$32 $24",
107
+ });
112
108
 
113
- export const AlertDialoghrStyled = styled('hr', {
109
+ export const AlertDialoghrStyled = styled("hr", {
114
110
  margin: 0,
115
111
  padding: 0,
116
- border: 'none',
117
- borderTop: '1px solid $neutral200',
118
- })
112
+ border: "none",
113
+ borderTop: "1px solid $neutral200",
114
+ });
119
115
 
120
116
  export type AlertProps = {
121
117
  trigger: React.ReactNode;
122
- color?: 'error' | 'warning' | 'success' | 'info';
118
+ color?: "error" | "warning" | "success" | "info";
123
119
  simpleAlert?: {
124
120
  description: string;
125
- cancel: boolean
126
- },
121
+ cancel: boolean;
122
+ };
127
123
  completAlert?: {
128
124
  title?: string;
129
125
  subtitle?: string;
@@ -132,8 +128,8 @@ export type AlertProps = {
132
128
  cancelText?: string;
133
129
  actionText?: string;
134
130
  onAction?: () => void;
135
- }
136
- }
131
+ };
132
+ };
137
133
 
138
134
  export function Alert({
139
135
  color,
@@ -142,15 +138,12 @@ export function Alert({
142
138
  simpleAlert,
143
139
  ...props
144
140
  }: AlertProps) {
145
- console.log('completAlert', completAlert, ' simpleAlert', simpleAlert)
146
141
  return (
147
142
  <>
148
143
  {simpleAlert && (
149
144
  <Theme>
150
145
  <AlertDialog.Root>
151
- <AlertDialog.Trigger>
152
- {trigger}
153
- </AlertDialog.Trigger>
146
+ <AlertDialog.Trigger>{trigger}</AlertDialog.Trigger>
154
147
  <>
155
148
  <AlertDialogSimpleStyled {...props}>
156
149
  <AlertDialogDescriptionStyled>
@@ -158,8 +151,8 @@ export function Alert({
158
151
  </AlertDialogDescriptionStyled>
159
152
  {simpleAlert.cancel && (
160
153
  <AlertDialog.Cancel>
161
- <Button variant='text'>
162
- <Icon name='close' />
154
+ <Button variant="text">
155
+ <Icon name="close" />
163
156
  </Button>
164
157
  </AlertDialog.Cancel>
165
158
  )}
@@ -171,78 +164,131 @@ export function Alert({
171
164
  {completAlert && (
172
165
  <Theme>
173
166
  <AlertDialog.Root>
174
- <AlertDialog.Trigger>
175
- {trigger}
176
- </AlertDialog.Trigger>
167
+ <AlertDialog.Trigger>{trigger}</AlertDialog.Trigger>
177
168
  <AlertDialogCompleteStyled>
178
- <AlertDialogRowStyled className='le-alert-dialog-row'>
179
- {color === 'success' && (<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
180
- <g clipPath="url(#clip0_1428_9995)">
181
- <path d="M28 56C35.4261 56 42.548 53.05 47.799 47.799C53.05 42.548 56 35.4261 56 28C56 20.5739 53.05 13.452 47.799 8.20101C42.548 2.94999 35.4261 0 28 0C20.5739 0 13.452 2.94999 8.20101 8.20101C2.94999 13.452 0 20.5739 0 28C0 35.4261 2.94999 42.548 8.20101 47.799C13.452 53.05 20.5739 56 28 56ZM40.3594 22.8594L26.3594 36.8594C25.3312 37.8875 23.6688 37.8875 22.6516 36.8594L15.6516 29.8594C14.6234 28.8312 14.6234 27.1688 15.6516 26.1516C16.6797 25.1344 18.3422 25.1234 19.3594 26.1516L24.5 31.2922L36.6406 19.1406C37.6688 18.1125 39.3312 18.1125 40.3484 19.1406C41.3656 20.1688 41.3766 21.8312 40.3484 22.8484L40.3594 22.8594Z" fill="#1E8535" />
182
- </g>
183
- <defs>
184
- <clipPath id="clip0_1428_9995">
185
- <rect width="56" height="56" fill="white" />
186
- </clipPath>
187
- </defs>
188
- </svg>
169
+ <AlertDialogRowStyled className="le-alert-dialog-row">
170
+ {color === "success" && (
171
+ <svg
172
+ width="56"
173
+ height="56"
174
+ viewBox="0 0 56 56"
175
+ fill="none"
176
+ xmlns="http://www.w3.org/2000/svg"
177
+ >
178
+ <g clipPath="url(#clip0_1428_9995)">
179
+ <path
180
+ d="M28 56C35.4261 56 42.548 53.05 47.799 47.799C53.05 42.548 56 35.4261 56 28C56 20.5739 53.05 13.452 47.799 8.20101C42.548 2.94999 35.4261 0 28 0C20.5739 0 13.452 2.94999 8.20101 8.20101C2.94999 13.452 0 20.5739 0 28C0 35.4261 2.94999 42.548 8.20101 47.799C13.452 53.05 20.5739 56 28 56ZM40.3594 22.8594L26.3594 36.8594C25.3312 37.8875 23.6688 37.8875 22.6516 36.8594L15.6516 29.8594C14.6234 28.8312 14.6234 27.1688 15.6516 26.1516C16.6797 25.1344 18.3422 25.1234 19.3594 26.1516L24.5 31.2922L36.6406 19.1406C37.6688 18.1125 39.3312 18.1125 40.3484 19.1406C41.3656 20.1688 41.3766 21.8312 40.3484 22.8484L40.3594 22.8594Z"
181
+ fill="#1E8535"
182
+ />
183
+ </g>
184
+ <defs>
185
+ <clipPath id="clip0_1428_9995">
186
+ <rect width="56" height="56" fill="white" />
187
+ </clipPath>
188
+ </defs>
189
+ </svg>
190
+ )}
191
+ {color === "error" && (
192
+ <svg
193
+ width="56"
194
+ height="56"
195
+ viewBox="0 0 56 56"
196
+ fill="none"
197
+ xmlns="http://www.w3.org/2000/svg"
198
+ >
199
+ <g clipPath="url(#clip0_1428_10022)">
200
+ <path
201
+ d="M28 56C35.4261 56 42.548 53.05 47.799 47.799C53.05 42.548 56 35.4261 56 28C56 20.5739 53.05 13.452 47.799 8.20101C42.548 2.94999 35.4261 0 28 0C20.5739 0 13.452 2.94999 8.20101 8.20101C2.94999 13.452 0 20.5739 0 28C0 35.4261 2.94999 42.548 8.20101 47.799C13.452 53.05 20.5739 56 28 56ZM19.1406 19.1406C20.1687 18.1125 21.8312 18.1125 22.8484 19.1406L27.9891 24.2812L33.1297 19.1406C34.1578 18.1125 35.8203 18.1125 36.8375 19.1406C37.8547 20.1687 37.8656 21.8312 36.8375 22.8484L31.6969 27.9891L36.8375 33.1297C37.8656 34.1578 37.8656 35.8203 36.8375 36.8375C35.8094 37.8547 34.1469 37.8656 33.1297 36.8375L27.9891 31.6969L22.8484 36.8375C21.8203 37.8656 20.1578 37.8656 19.1406 36.8375C18.1234 35.8094 18.1125 34.1469 19.1406 33.1297L24.2812 27.9891L19.1406 22.8484C18.1125 21.8203 18.1125 20.1578 19.1406 19.1406Z"
202
+ fill="#AD1F2B"
203
+ />
204
+ </g>
205
+ <defs>
206
+ <clipPath id="clip0_1428_10022">
207
+ <rect width="56" height="56" fill="white" />
208
+ </clipPath>
209
+ </defs>
210
+ </svg>
211
+ )}
212
+ {color === "warning" && (
213
+ <svg
214
+ width="56"
215
+ height="56"
216
+ viewBox="0 0 56 56"
217
+ fill="none"
218
+ xmlns="http://www.w3.org/2000/svg"
219
+ >
220
+ <g clipPath="url(#clip0_1428_10038)">
221
+ <path
222
+ d="M28 56C35.4261 56 42.548 53.05 47.799 47.799C53.05 42.548 56 35.4261 56 28C56 20.5739 53.05 13.452 47.799 8.20101C42.548 2.94999 35.4261 0 28 0C20.5739 0 13.452 2.94999 8.20101 8.20101C2.94999 13.452 0 20.5739 0 28C0 35.4261 2.94999 42.548 8.20101 47.799C13.452 53.05 20.5739 56 28 56ZM28 14C29.4547 14 30.625 15.1703 30.625 16.625V28.875C30.625 30.3297 29.4547 31.5 28 31.5C26.5453 31.5 25.375 30.3297 25.375 28.875V16.625C25.375 15.1703 26.5453 14 28 14ZM24.5 38.5C24.5 37.5717 24.8687 36.6815 25.5251 36.0251C26.1815 35.3688 27.0717 35 28 35C28.9283 35 29.8185 35.3688 30.4749 36.0251C31.1313 36.6815 31.5 37.5717 31.5 38.5C31.5 39.4283 31.1313 40.3185 30.4749 40.9749C29.8185 41.6312 28.9283 42 28 42C27.0717 42 26.1815 41.6312 25.5251 40.9749C24.8687 40.3185 24.5 39.4283 24.5 38.5Z"
223
+ fill="#CC9A06"
224
+ />
225
+ </g>
226
+ <defs>
227
+ <clipPath id="clip0_1428_10038">
228
+ <rect width="56" height="56" fill="white" />
229
+ </clipPath>
230
+ </defs>
231
+ </svg>
232
+ )}
233
+ {color === "info" && (
234
+ <svg
235
+ width="40"
236
+ height="40"
237
+ viewBox="0 0 40 40"
238
+ fill="none"
239
+ xmlns="http://www.w3.org/2000/svg"
240
+ >
241
+ <g clipPath="url(#clip0_1645_46)">
242
+ <path
243
+ d="M20 40C25.3043 40 30.3914 37.8929 34.1421 34.1421C37.8929 30.3914 40 25.3043 40 20C40 14.6957 37.8929 9.60859 34.1421 5.85786C30.3914 2.10714 25.3043 0 20 0C14.6957 0 9.60859 2.10714 5.85786 5.85786C2.10714 9.60859 0 14.6957 0 20C0 25.3043 2.10714 30.3914 5.85786 34.1421C9.60859 37.8929 14.6957 40 20 40ZM20 10C21.0391 10 21.875 10.8359 21.875 11.875V20.625C21.875 21.6641 21.0391 22.5 20 22.5C18.9609 22.5 18.125 21.6641 18.125 20.625V11.875C18.125 10.8359 18.9609 10 20 10ZM17.5 27.5C17.5 26.837 17.7634 26.2011 18.2322 25.7322C18.7011 25.2634 19.337 25 20 25C20.663 25 21.2989 25.2634 21.7678 25.7322C22.2366 26.2011 22.5 26.837 22.5 27.5C22.5 28.163 22.2366 28.7989 21.7678 29.2678C21.2989 29.7366 20.663 30 20 30C19.337 30 18.7011 29.7366 18.2322 29.2678C17.7634 28.7989 17.5 28.163 17.5 27.5Z"
244
+ fill="#9FB6C7"
245
+ />
246
+ </g>
247
+ <defs>
248
+ <clipPath id="clip0_1645_46">
249
+ <rect width="40" height="40" fill="white" />
250
+ </clipPath>
251
+ </defs>
252
+ </svg>
189
253
  )}
190
- {color === 'error' && (<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
191
- <g clipPath="url(#clip0_1428_10022)">
192
- <path d="M28 56C35.4261 56 42.548 53.05 47.799 47.799C53.05 42.548 56 35.4261 56 28C56 20.5739 53.05 13.452 47.799 8.20101C42.548 2.94999 35.4261 0 28 0C20.5739 0 13.452 2.94999 8.20101 8.20101C2.94999 13.452 0 20.5739 0 28C0 35.4261 2.94999 42.548 8.20101 47.799C13.452 53.05 20.5739 56 28 56ZM19.1406 19.1406C20.1687 18.1125 21.8312 18.1125 22.8484 19.1406L27.9891 24.2812L33.1297 19.1406C34.1578 18.1125 35.8203 18.1125 36.8375 19.1406C37.8547 20.1687 37.8656 21.8312 36.8375 22.8484L31.6969 27.9891L36.8375 33.1297C37.8656 34.1578 37.8656 35.8203 36.8375 36.8375C35.8094 37.8547 34.1469 37.8656 33.1297 36.8375L27.9891 31.6969L22.8484 36.8375C21.8203 37.8656 20.1578 37.8656 19.1406 36.8375C18.1234 35.8094 18.1125 34.1469 19.1406 33.1297L24.2812 27.9891L19.1406 22.8484C18.1125 21.8203 18.1125 20.1578 19.1406 19.1406Z" fill="#AD1F2B" />
193
- </g>
194
- <defs>
195
- <clipPath id="clip0_1428_10022">
196
- <rect width="56" height="56" fill="white" />
197
- </clipPath>
198
- </defs>
199
- </svg>)}
200
- {color === 'warning' && (<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
201
- <g clipPath="url(#clip0_1428_10038)">
202
- <path d="M28 56C35.4261 56 42.548 53.05 47.799 47.799C53.05 42.548 56 35.4261 56 28C56 20.5739 53.05 13.452 47.799 8.20101C42.548 2.94999 35.4261 0 28 0C20.5739 0 13.452 2.94999 8.20101 8.20101C2.94999 13.452 0 20.5739 0 28C0 35.4261 2.94999 42.548 8.20101 47.799C13.452 53.05 20.5739 56 28 56ZM28 14C29.4547 14 30.625 15.1703 30.625 16.625V28.875C30.625 30.3297 29.4547 31.5 28 31.5C26.5453 31.5 25.375 30.3297 25.375 28.875V16.625C25.375 15.1703 26.5453 14 28 14ZM24.5 38.5C24.5 37.5717 24.8687 36.6815 25.5251 36.0251C26.1815 35.3688 27.0717 35 28 35C28.9283 35 29.8185 35.3688 30.4749 36.0251C31.1313 36.6815 31.5 37.5717 31.5 38.5C31.5 39.4283 31.1313 40.3185 30.4749 40.9749C29.8185 41.6312 28.9283 42 28 42C27.0717 42 26.1815 41.6312 25.5251 40.9749C24.8687 40.3185 24.5 39.4283 24.5 38.5Z" fill="#CC9A06" />
203
- </g>
204
- <defs>
205
- <clipPath id="clip0_1428_10038">
206
- <rect width="56" height="56" fill="white" />
207
- </clipPath>
208
- </defs>
209
- </svg>)}
210
- {color === 'info' && (<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
211
- <g clipPath="url(#clip0_1645_46)">
212
- <path d="M20 40C25.3043 40 30.3914 37.8929 34.1421 34.1421C37.8929 30.3914 40 25.3043 40 20C40 14.6957 37.8929 9.60859 34.1421 5.85786C30.3914 2.10714 25.3043 0 20 0C14.6957 0 9.60859 2.10714 5.85786 5.85786C2.10714 9.60859 0 14.6957 0 20C0 25.3043 2.10714 30.3914 5.85786 34.1421C9.60859 37.8929 14.6957 40 20 40ZM20 10C21.0391 10 21.875 10.8359 21.875 11.875V20.625C21.875 21.6641 21.0391 22.5 20 22.5C18.9609 22.5 18.125 21.6641 18.125 20.625V11.875C18.125 10.8359 18.9609 10 20 10ZM17.5 27.5C17.5 26.837 17.7634 26.2011 18.2322 25.7322C18.7011 25.2634 19.337 25 20 25C20.663 25 21.2989 25.2634 21.7678 25.7322C22.2366 26.2011 22.5 26.837 22.5 27.5C22.5 28.163 22.2366 28.7989 21.7678 29.2678C21.2989 29.7366 20.663 30 20 30C19.337 30 18.7011 29.7366 18.2322 29.2678C17.7634 28.7989 17.5 28.163 17.5 27.5Z" fill="#9FB6C7" />
213
- </g>
214
- <defs>
215
- <clipPath id="clip0_1645_46">
216
- <rect width="40" height="40" fill="white" />
217
- </clipPath>
218
- </defs>
219
- </svg>)}
220
- {completAlert.title &&
254
+ {completAlert.title && (
221
255
  <AlertDialogTitleStyled>
222
256
  {completAlert.title}
223
257
  </AlertDialogTitleStyled>
224
- }
258
+ )}
225
259
  <AlertDialogDescriptionStyled>
226
- {completAlert.subtitle && <Text css={{
227
- fontSize: '$16'
228
- }} asChild><h2>{completAlert.subtitle}</h2></Text>}
260
+ {completAlert.subtitle && (
261
+ <Text
262
+ css={{
263
+ fontSize: "$16",
264
+ }}
265
+ asChild
266
+ >
267
+ <h2>{completAlert.subtitle}</h2>
268
+ </Text>
269
+ )}
229
270
  {completAlert.description}
230
271
  </AlertDialogDescriptionStyled>
231
272
  </AlertDialogRowStyled>
232
- {completAlert.onAction || completAlert.cancel ? (<AlertDialoghrStyled />) : null}
273
+ {completAlert.onAction || completAlert.cancel ? (
274
+ <AlertDialoghrStyled />
275
+ ) : null}
233
276
  <AlertDialogRowStyled>
234
- <Flex gap="10" justify="end" width={'100%'}>
277
+ <Flex gap="10" justify="end" width={"100%"}>
235
278
  {completAlert.onAction && (
236
279
  <AlertDialog.Action>
237
- <Button variant='contained' onClick={completAlert.onAction}>
238
- {completAlert.actionText || 'Salvar'}
280
+ <Button
281
+ variant="contained"
282
+ onClick={completAlert.onAction}
283
+ >
284
+ {completAlert.actionText || "Salvar"}
239
285
  </Button>
240
286
  </AlertDialog.Action>
241
287
  )}
242
288
  {completAlert.cancel && (
243
289
  <AlertDialog.Cancel>
244
- <Button variant='outlined' color={'neutral'}>
245
- {completAlert.cancelText || 'Cancelar'}
290
+ <Button variant="outlined" color={"neutral"}>
291
+ {completAlert.cancelText || "Cancelar"}
246
292
  </Button>
247
293
  </AlertDialog.Cancel>
248
294
  )}
@@ -252,5 +298,6 @@ export function Alert({
252
298
  </AlertDialog.Root>
253
299
  </Theme>
254
300
  )}
255
- </>)
256
- }
301
+ </>
302
+ );
303
+ }
@@ -2,7 +2,6 @@ import React from 'react'
2
2
  import { ComponentProps, ElementType } from 'react'
3
3
  import { styled } from '../styles'
4
4
  import { Badge as BadgeRadix } from '@radix-ui/themes'
5
- import { fontWeights } from '@lets-events/tokens'
6
5
  export const BadgeStyled = styled(BadgeRadix, {
7
6
  fontFamily: '$default',
8
7
  borderRadius: '$sm',
@@ -47,7 +47,6 @@ export function Calendar({
47
47
  const dropdownRef = useRef<HTMLDivElement>(null);
48
48
 
49
49
  useOnClickOutside(dropdownRef, () => {
50
- console.warn("Clicked outside");
51
50
  setShowCalendar(false);
52
51
  });
53
52
  const today = new Date();
@@ -76,7 +75,10 @@ export function Calendar({
76
75
  return (
77
76
  <div>
78
77
  <CalendarStyled {...props} ref={dropdownRef}>
79
- <CalendarButtonStyled onClick={() => setShowCalendar((prev) => !prev)}>
78
+ <CalendarButtonStyled
79
+ type="button"
80
+ onClick={() => setShowCalendar((prev) => !prev)}
81
+ >
80
82
  <TextField
81
83
  placeholder="00/00/0000"
82
84
  type="text"
@@ -115,6 +117,7 @@ export function Calendar({
115
117
  <Button
116
118
  variant="text"
117
119
  color="brand"
120
+ type="button"
118
121
  onClick={() => {
119
122
  setShowCalendar(false);
120
123
  }}
@@ -0,0 +1,69 @@
1
+ import React from 'react'
2
+ import { ComponentProps, ElementType } from 'react'
3
+ import { styled } from '../styles'
4
+ import { Box, Card as CardRadix } from '@radix-ui/themes'
5
+
6
+ export const CardStyled = styled(CardRadix, {
7
+ display: 'flex',
8
+ flexDirection: 'column',
9
+ width: '370px',
10
+ borderRadius: '$2xl',
11
+ border: '1px solid $dark100',
12
+ overflow: 'hidden',
13
+ padding: '16px',
14
+ defaultVariants: {
15
+ color: 'primary',
16
+ boxShadow: true,
17
+ },
18
+ variants: {
19
+ color: {
20
+ primary: {
21
+ backgroundColor: '$dark50',
22
+ border: '1px solid $dark200',
23
+ },
24
+ disable: {
25
+ backgroundColor: '$grey50',
26
+ border: '1px solid $dark200',
27
+ },
28
+ error: {
29
+ backgroundColor: '$error50',
30
+ border: '1px solid $error600',
31
+ }
32
+ },
33
+ boxShadow:{
34
+ true: {
35
+ boxShadow: '0 2px 4px rgba(35, 53, 67, 0.16), 0 4px 4px rgba(35, 53, 67, 0.08)',
36
+ },
37
+ false: {
38
+ boxShadow: 'none',
39
+ }
40
+ }
41
+ }
42
+ });
43
+
44
+
45
+
46
+ export const CardContainer = styled(Box, {
47
+ display: 'flex',
48
+ flexDirection: 'row'
49
+ })
50
+
51
+ export type CardProps = ComponentProps<typeof CardStyled> & {
52
+ children: React.ReactNode
53
+ as?: ElementType
54
+ }
55
+
56
+
57
+
58
+ export function Card({ asChild, children, ...props }: CardProps) {
59
+ return (
60
+ <CardStyled {...props}>
61
+ {React.Children.map(children, (child) => {
62
+ if (React.isValidElement(child)) {
63
+ return React.cloneElement(child, { size: props.size } as any)
64
+ }
65
+ return child
66
+ })}
67
+ </CardStyled>
68
+ )
69
+ }