@lets-events/react 11.3.0 → 11.4.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.
Files changed (58) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +18 -20
  3. package/CHANGELOG.md +12 -0
  4. package/dist/index.d.mts +968 -207
  5. package/dist/index.d.ts +968 -207
  6. package/dist/index.js +266 -54
  7. package/dist/index.mjs +262 -48
  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 +125 -128
  12. package/src/components/Box.tsx +3 -3
  13. package/src/components/Button/index.tsx +16 -16
  14. package/src/components/Button/styledComponents.ts +287 -287
  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 +196 -214
  20. package/src/components/Container.tsx +39 -39
  21. package/src/components/Drawer/index.tsx +48 -48
  22. package/src/components/Drawer/styledComponents.ts +46 -46
  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/MultiSelectFormField.tsx +59 -0
  30. package/src/components/FormFields/TextAreaFormField.tsx +46 -46
  31. package/src/components/FormFields/TextFormField.tsx +46 -46
  32. package/src/components/Grid.tsx +137 -137
  33. package/src/components/Icon.tsx +47 -47
  34. package/src/components/MenuDropdown/index.tsx +30 -30
  35. package/src/components/MenuDropdown/styledComponents.ts +31 -31
  36. package/src/components/Modal.tsx +90 -90
  37. package/src/components/MultiSelect.tsx +218 -0
  38. package/src/components/RadioGroup.tsx +210 -210
  39. package/src/components/Section.tsx +33 -33
  40. package/src/components/Step.tsx +164 -164
  41. package/src/components/Switch.tsx +108 -108
  42. package/src/components/Text.tsx +38 -39
  43. package/src/components/TextField.tsx +315 -315
  44. package/src/components/TextareaField.tsx +128 -128
  45. package/src/components/TimePicker.tsx +298 -298
  46. package/src/components/Toast/components/ToastItem.tsx +41 -41
  47. package/src/components/Toast/components/ToastProvider.tsx +63 -63
  48. package/src/components/Toast/hooks/useToast.ts +12 -12
  49. package/src/components/Toast/index.tsx +5 -5
  50. package/src/components/Toast/styles/index.ts +135 -135
  51. package/src/components/Toast/types/index.ts +46 -46
  52. package/src/components/Tooltip/index.tsx +66 -66
  53. package/src/components/Tooltip/styles.ts +77 -77
  54. package/src/hooks/useOnClickOutside.tsx +20 -20
  55. package/src/index.tsx +44 -42
  56. package/src/styles/index.ts +38 -38
  57. package/src/types/typographyValues.ts +178 -178
  58. package/tsconfig.json +3 -3
@@ -1,214 +1,196 @@
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
+ color: "blue",
111
+ disabled: false,
112
+ css: {
113
+ label: {
114
+ "&:focus button, &:hover button": {
115
+ boxShadow: "0px 0px 0px 4px rgba(56, 129, 255, 0.50)",
116
+ },
117
+ },
118
+ "label button": {
119
+ borderColor: "$dark300",
120
+ },
121
+ "label button[data-state=checked]:after": {
122
+ backgroundColor: "$brand500",
123
+ },
124
+ },
125
+ },
126
+
127
+ {
128
+ color: "blue",
129
+ disabled: true,
130
+ css: {
131
+ "label button": {
132
+ borderColor: "$brand100",
133
+ backgroundColor: "$dark50",
134
+ },
135
+ "label button[data-state=checked]:after": {
136
+ backgroundColor: "$brand100",
137
+ },
138
+ },
139
+ },
140
+
141
+ {
142
+ color: "success",
143
+ disabled: true,
144
+ css: {
145
+ "label button": {
146
+ borderColor: "$success100",
147
+ backgroundColor: "$dark50",
148
+ },
149
+ "label button[data-state=checked]:after": {
150
+ backgroundColor: "$success100",
151
+ },
152
+ },
153
+ },
154
+
155
+ {
156
+ color: "error",
157
+ disabled: true,
158
+ css: {
159
+ "label button": {
160
+ borderColor: "$error100",
161
+ backgroundColor: "$dark50",
162
+ },
163
+ "label button[data-state=checked]:after": {
164
+ backgroundColor: "$error100",
165
+ },
166
+ },
167
+ },
168
+ ],
169
+ defaultVariants: {
170
+ color: "blue",
171
+ disabled: false,
172
+ },
173
+ });
174
+
175
+ const StyledItem = styled(CheckboxGroupRadix.Item, {});
176
+
177
+ export type CheckboxGroupProps = ComponentProps<typeof CheckboxGroupStyled> & {
178
+ placeholder?: string;
179
+ children?: React.ReactNode;
180
+ color?: string;
181
+ disabled?: boolean;
182
+ };
183
+
184
+ export type CheckboxItemProps = ComponentProps<typeof StyledItem> & {
185
+ children?: React.ReactNode;
186
+ value: string;
187
+ style?: React.CSSProperties;
188
+ };
189
+
190
+ export function CheckboxGroup({ children, ...props }: CheckboxGroupProps) {
191
+ return <CheckboxGroupStyled {...props}>{children}</CheckboxGroupStyled>;
192
+ }
193
+
194
+ export function CheckboxItem({ children, ...props }: CheckboxItemProps) {
195
+ return <StyledItem {...props}>{children}</StyledItem>;
196
+ }
@@ -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
  }
@@ -1,48 +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
- }
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
+ }