@lets-events/react 11.2.0 → 11.3.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 (56) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +20 -18
  3. package/CHANGELOG.md +6 -0
  4. package/dist/index.d.mts +771 -12
  5. package/dist/index.d.ts +771 -12
  6. package/dist/index.js +283 -146
  7. package/dist/index.mjs +260 -125
  8. package/package.json +1 -1
  9. package/src/components/Alert.tsx +303 -303
  10. package/src/components/Avatar.tsx +55 -55
  11. package/src/components/Badge.tsx +128 -128
  12. package/src/components/Box.tsx +3 -3
  13. package/src/components/Button/index.tsx +16 -13
  14. package/src/components/Button/styledComponents.ts +287 -276
  15. package/src/components/ButtonGroup.tsx +484 -484
  16. package/src/components/Calendar/index.tsx +136 -136
  17. package/src/components/Calendar/styledComponents.ts +209 -209
  18. package/src/components/Card.tsx +48 -48
  19. package/src/components/CheckboxGroup.tsx +214 -214
  20. package/src/components/Container.tsx +39 -39
  21. package/src/components/Drawer/index.tsx +48 -0
  22. package/src/components/Drawer/styledComponents.ts +46 -0
  23. package/src/components/Dropdown.tsx +167 -167
  24. package/src/components/Filter.tsx +164 -164
  25. package/src/components/Flex.tsx +118 -118
  26. package/src/components/FormFields/ErrorFormMessage.tsx +36 -36
  27. package/src/components/FormFields/Form.tsx +25 -25
  28. package/src/components/FormFields/FormLabel.tsx +29 -29
  29. package/src/components/FormFields/TextAreaFormField.tsx +46 -46
  30. package/src/components/FormFields/TextFormField.tsx +46 -46
  31. package/src/components/Grid.tsx +137 -137
  32. package/src/components/Icon.tsx +47 -47
  33. package/src/components/MenuDropdown/index.tsx +30 -0
  34. package/src/components/MenuDropdown/styledComponents.ts +31 -0
  35. package/src/components/Modal.tsx +90 -90
  36. package/src/components/RadioGroup.tsx +210 -210
  37. package/src/components/Section.tsx +33 -33
  38. package/src/components/Step.tsx +164 -164
  39. package/src/components/Switch.tsx +108 -108
  40. package/src/components/Text.tsx +39 -39
  41. package/src/components/TextField.tsx +315 -315
  42. package/src/components/TextareaField.tsx +128 -128
  43. package/src/components/TimePicker.tsx +298 -298
  44. package/src/components/Toast/components/ToastItem.tsx +41 -41
  45. package/src/components/Toast/components/ToastProvider.tsx +63 -63
  46. package/src/components/Toast/hooks/useToast.ts +12 -12
  47. package/src/components/Toast/index.tsx +5 -5
  48. package/src/components/Toast/styles/index.ts +135 -135
  49. package/src/components/Toast/types/index.ts +46 -46
  50. package/src/components/Tooltip/index.tsx +66 -66
  51. package/src/components/Tooltip/styles.ts +77 -77
  52. package/src/hooks/useOnClickOutside.tsx +20 -20
  53. package/src/index.tsx +42 -40
  54. package/src/styles/index.ts +38 -38
  55. package/src/types/typographyValues.ts +178 -178
  56. package/tsconfig.json +3 -3
@@ -1,214 +1,214 @@
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
-
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
+
@@ -1,40 +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>;
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
40
  }
@@ -0,0 +1,48 @@
1
+ import { ComponentProps, ReactNode } from "react";
2
+ import { colors, Colors } from "@lets-events/tokens";
3
+ import Icon from "../Icon";
4
+ import {
5
+ DrawerOverlayStyled,
6
+ DrawerContainerStyled,
7
+ DrawerHeaderDiv,
8
+ DrawerHeaderTitle,
9
+ DrawerHeaderCloseButton,
10
+ } from "./styledComponents";
11
+
12
+ export type DrawerProps = ComponentProps<typeof DrawerOverlayStyled> & {
13
+ isOpen: boolean;
14
+ onClose: () => void;
15
+ width?: string;
16
+ backgroundColor?: keyof Colors;
17
+ title: string;
18
+ children?: ReactNode;
19
+ };
20
+
21
+ export function Drawer({
22
+ isOpen,
23
+ onClose,
24
+ width,
25
+ backgroundColor,
26
+ title,
27
+ children,
28
+ }: DrawerProps) {
29
+ if (!isOpen) return null;
30
+ return (
31
+ <DrawerOverlayStyled>
32
+ <DrawerContainerStyled
33
+ style={{
34
+ width: width ?? "34.25rem",
35
+ backgroundColor: colors[backgroundColor ?? "neutral50"],
36
+ }}
37
+ >
38
+ <DrawerHeaderDiv>
39
+ <DrawerHeaderTitle>{title}</DrawerHeaderTitle>
40
+ <DrawerHeaderCloseButton onClick={onClose}>
41
+ <Icon size={"xl"} color="$dark600" name="xmark" />
42
+ </DrawerHeaderCloseButton>
43
+ </DrawerHeaderDiv>
44
+ {children}
45
+ </DrawerContainerStyled>
46
+ </DrawerOverlayStyled>
47
+ );
48
+ }
@@ -0,0 +1,46 @@
1
+ import { styled } from "../../styles";
2
+
3
+ export const DrawerOverlayStyled = styled("div", {
4
+ position: "fixed",
5
+ top: 0,
6
+ right: 0,
7
+ width: "100vw",
8
+ height: "100vh",
9
+ background: "rgba(0, 0, 0, 0.4)",
10
+ zIndex: 1000,
11
+ });
12
+
13
+ export const DrawerContainerStyled = styled("div", {
14
+ position: "absolute",
15
+ top: 0,
16
+ right: 0,
17
+ maxWidth: "calc(100% - 2rem)",
18
+ height: "100%",
19
+ background: "$neutral50",
20
+ display: "flex",
21
+ flexDirection: "column",
22
+ boxShadow: "-4px 0 12px rgba(0, 0, 0, 0.2)",
23
+ padding: "1.5rem 0",
24
+ overflowY: "auto",
25
+ });
26
+
27
+ export const DrawerHeaderDiv = styled("div", {
28
+ display: "flex",
29
+ justifyContent: "space-between",
30
+ alignItems: "center",
31
+ borderBottom: "1px solid $neutral300",
32
+ padding: "0 1.5rem 1rem",
33
+ position: "relative",
34
+ });
35
+ export const DrawerHeaderTitle = styled("h2", {
36
+ fontSize: "1.125rem",
37
+ fontWeight: "400",
38
+ fontFamily: "Work Sans",
39
+ color: "$dark800",
40
+ margin: "0",
41
+ });
42
+ export const DrawerHeaderCloseButton = styled("button", {
43
+ background: "none",
44
+ border: "none",
45
+ cursor: "pointer",
46
+ });