@lets-events/react 11.8.0 → 12.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 (87) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +21 -18
  3. package/CHANGELOG.md +12 -0
  4. package/dist/index.d.mts +124 -6
  5. package/dist/index.d.ts +124 -6
  6. package/dist/index.js +1033 -276
  7. package/dist/index.mjs +1027 -276
  8. package/package.json +7 -2
  9. package/src/components/Alert.tsx +303 -303
  10. package/src/components/Avatar.tsx +55 -55
  11. package/src/components/Badge.tsx +125 -125
  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 +139 -136
  17. package/src/components/Calendar/styledComponents.ts +209 -209
  18. package/src/components/Card.tsx +48 -48
  19. package/src/components/CheckboxGroup.tsx +176 -176
  20. package/src/components/Container.tsx +39 -39
  21. package/src/components/Drawer/index.tsx +55 -55
  22. package/src/components/Drawer/styledComponents.ts +46 -46
  23. package/src/components/Dropdown.tsx +302 -302
  24. package/src/components/Filter.tsx +164 -164
  25. package/src/components/Flex.tsx +118 -118
  26. package/src/components/FormFields/AddressFormFields/CityFormField.tsx +111 -111
  27. package/src/components/FormFields/AddressFormFields/CountryFormField.tsx +33 -33
  28. package/src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx +39 -39
  29. package/src/components/FormFields/AddressFormFields/StateFormField.tsx +32 -32
  30. package/src/components/FormFields/AddressFormFields/index.tsx +141 -141
  31. package/src/components/FormFields/BirthDateFormField.tsx +84 -84
  32. package/src/components/FormFields/CNPJFormField.tsx +87 -87
  33. package/src/components/FormFields/CPFFormField.tsx +78 -78
  34. package/src/components/FormFields/CalendarFormField.tsx +89 -0
  35. package/src/components/FormFields/CheckboxGroupFormField.tsx +91 -91
  36. package/src/components/FormFields/EmailFormField.tsx +27 -27
  37. package/src/components/FormFields/Form.tsx +39 -39
  38. package/src/components/FormFields/IdentityDocumentNumberFormField.tsx +40 -40
  39. package/src/components/FormFields/MultiSelectFormField.tsx +61 -55
  40. package/src/components/FormFields/PhoneFormField.tsx +40 -40
  41. package/src/components/FormFields/RadioGroupFormField.tsx +84 -84
  42. package/src/components/FormFields/RichEditorFormField.tsx +69 -0
  43. package/src/components/FormFields/SelectFormField.tsx +93 -93
  44. package/src/components/FormFields/TextAreaFormField.tsx +57 -48
  45. package/src/components/FormFields/TextFormField.tsx +112 -112
  46. package/src/components/FormFields/TimePickerFormField.tsx +88 -0
  47. package/src/components/FormFields/subComponents/ErrorFormMessage.tsx +36 -36
  48. package/src/components/FormFields/subComponents/FormLabel.tsx +29 -29
  49. package/src/components/FormFields/utils/validation.ts +23 -23
  50. package/src/components/Grid.tsx +137 -137
  51. package/src/components/Icon.tsx +47 -47
  52. package/src/components/MenuDropdown/index.tsx +38 -38
  53. package/src/components/MenuDropdown/styledComponents.ts +31 -31
  54. package/src/components/Modal.tsx +90 -90
  55. package/src/components/MultiSelect.tsx +266 -252
  56. package/src/components/RadioGroup.tsx +210 -210
  57. package/src/components/RichEditor/QuillComponent.tsx +415 -0
  58. package/src/components/RichEditor/RichEditor.tsx +38 -0
  59. package/src/components/RichEditor/index.ts +2 -0
  60. package/src/components/RichEditor/styledComponents.ts +62 -0
  61. package/src/components/Section.tsx +33 -33
  62. package/src/components/Step.tsx +164 -164
  63. package/src/components/Switch.tsx +108 -108
  64. package/src/components/Text.tsx +38 -38
  65. package/src/components/TextField.tsx +372 -365
  66. package/src/components/TextareaField.tsx +128 -128
  67. package/src/components/TimePicker.tsx +301 -298
  68. package/src/components/Toast/components/ToastItem.tsx +41 -41
  69. package/src/components/Toast/components/ToastProvider.tsx +63 -63
  70. package/src/components/Toast/hooks/useToast.ts +12 -12
  71. package/src/components/Toast/index.tsx +5 -5
  72. package/src/components/Toast/styles/index.ts +135 -135
  73. package/src/components/Toast/types/index.ts +46 -46
  74. package/src/components/Tooltip/index.tsx +66 -66
  75. package/src/components/Tooltip/styles.ts +77 -77
  76. package/src/hooks/useCountries.ts +41 -41
  77. package/src/hooks/useImageUpload.ts +139 -0
  78. package/src/hooks/useOnClickOutside.tsx +20 -20
  79. package/src/index.tsx +67 -55
  80. package/src/styles/index.ts +38 -38
  81. package/src/types/typographyValues.ts +178 -178
  82. package/src/utils/getNestedValue.ts +3 -3
  83. package/src/utils/states.ts +29 -29
  84. package/src/utils/uploadService.ts +180 -0
  85. package/tsconfig.json +3 -3
  86. package/tsup.config.ts +38 -0
  87. package/dist/index.css +0 -171
@@ -1,164 +1,164 @@
1
- import React, { ComponentProps, ElementType } from "react";
2
- import { styled } from "../styles";
3
- import { Box, Tabs as StepRadix } from "@radix-ui/themes";
4
-
5
- export const StepStyled = styled("div", {
6
- fontFamily: "$default",
7
- color: "$gray100",
8
- letterSpacing: "0px",
9
- });
10
-
11
- const StepTriggerStyled = styled(StepRadix.Trigger, {
12
- all: "unset",
13
- position: "relative",
14
- display: "flex",
15
- alignItems: "center",
16
- justifyContent: "center",
17
- fontSize: "$16",
18
- fontWeight: "$medium",
19
-
20
- minWidth: "32px",
21
- minHeight: "32px",
22
- marginRight: "40px",
23
-
24
- "&:last-of-type": {
25
- marginRight: 0,
26
- },
27
-
28
- "& > span:first-of-type": {
29
- width: "32px",
30
- height: "32px",
31
- borderRadius: "$full",
32
- backgroundColor: "$neutral50",
33
- border: "1px solid $neutral200",
34
- color: "$gray700",
35
- display: "flex",
36
- alignItems: "center",
37
- justifyContent: "center",
38
- zIndex: 1,
39
- position: "relative",
40
- },
41
-
42
- '&[data-state="active"] > span:first-of-type': {
43
- backgroundColor: "$blue500",
44
- borderColor: "$blue500",
45
- color: "white",
46
- },
47
-
48
- "& > span:last-of-type": {
49
- display: "none",
50
- },
51
-
52
- "&:not(:first-of-type)::before": {
53
- content: '""',
54
- position: "absolute",
55
- top: "50%",
56
- right: "calc(100% + 4px)",
57
- transform: "translateY(-50%)",
58
- width: "32px",
59
- height: "8px",
60
- borderRadius: "$sm",
61
- backgroundColor: "$neutral50",
62
- zIndex: 0,
63
- },
64
-
65
- '&[data-state="active"]::before': {
66
- backgroundColor: "$blue500",
67
- },
68
-
69
- '&[data-filled="true"] > span:first-of-type': {
70
- backgroundColor: "$blue500",
71
- borderColor: "$blue500",
72
- color: "white",
73
- },
74
-
75
- '&[data-filled="true"]::before': {
76
- backgroundColor: "$blue500",
77
- },
78
- });
79
-
80
- const StepListStyled = styled(StepRadix.List, {
81
- display: "flex",
82
- alignItems: "center",
83
- justifyContent: "flex-start",
84
- gap: "$4",
85
- });
86
-
87
- export type StepProps = ComponentProps<typeof StepStyled> & {
88
- children: React.ReactNode;
89
- defaultValue: number;
90
- };
91
- export function Step({ children, defaultValue, ...props }: StepProps) {
92
- return (
93
- <StepRadix.Root defaultValue={String(defaultValue)}>
94
- <StepStyled {...props}>{children}</StepStyled>
95
- </StepRadix.Root>
96
- );
97
- }
98
-
99
- export function StepTrigger({
100
- value,
101
- children,
102
- currentStep,
103
- ...props
104
- }: {
105
- value: number;
106
- children: React.ReactNode | string;
107
- currentStep?: number;
108
- onClick: () => void;
109
- }) {
110
- const isActiveOrPrevious = currentStep !== undefined && value <= currentStep;
111
- return (
112
- <StepTriggerStyled
113
- data-filled={isActiveOrPrevious}
114
- value={String(value)}
115
- {...props}
116
- >
117
- {children}
118
- </StepTriggerStyled>
119
- );
120
- }
121
-
122
- export function StepContent({
123
- value,
124
- children,
125
- ...props
126
- }: {
127
- value: number;
128
- children: React.ReactNode;
129
- }) {
130
- return (
131
- <StepRadix.Content value={String(value)} {...props}>
132
- {children}
133
- </StepRadix.Content>
134
- );
135
- }
136
-
137
- export function StepList({
138
- children,
139
- currentStep,
140
- ...props
141
- }: {
142
- children: React.ReactNode;
143
- currentStep: number;
144
- }) {
145
- return (
146
- <StepListStyled {...props}>
147
- {React.Children.map(children, (child) => {
148
- if (React.isValidElement(child) && child.type === StepTrigger) {
149
- return React.cloneElement(child, { currentStep } as any);
150
- }
151
- return child;
152
- })}
153
- </StepListStyled>
154
- );
155
- }
156
-
157
- export function StepWrapper({
158
- children,
159
- ...props
160
- }: {
161
- children: React.ReactNode;
162
- }) {
163
- return <Box {...props}>{children}</Box>;
164
- }
1
+ import React, { ComponentProps, ElementType } from "react";
2
+ import { styled } from "../styles";
3
+ import { Box, Tabs as StepRadix } from "@radix-ui/themes";
4
+
5
+ export const StepStyled = styled("div", {
6
+ fontFamily: "$default",
7
+ color: "$gray100",
8
+ letterSpacing: "0px",
9
+ });
10
+
11
+ const StepTriggerStyled = styled(StepRadix.Trigger, {
12
+ all: "unset",
13
+ position: "relative",
14
+ display: "flex",
15
+ alignItems: "center",
16
+ justifyContent: "center",
17
+ fontSize: "$16",
18
+ fontWeight: "$medium",
19
+
20
+ minWidth: "32px",
21
+ minHeight: "32px",
22
+ marginRight: "40px",
23
+
24
+ "&:last-of-type": {
25
+ marginRight: 0,
26
+ },
27
+
28
+ "& > span:first-of-type": {
29
+ width: "32px",
30
+ height: "32px",
31
+ borderRadius: "$full",
32
+ backgroundColor: "$neutral50",
33
+ border: "1px solid $neutral200",
34
+ color: "$gray700",
35
+ display: "flex",
36
+ alignItems: "center",
37
+ justifyContent: "center",
38
+ zIndex: 1,
39
+ position: "relative",
40
+ },
41
+
42
+ '&[data-state="active"] > span:first-of-type': {
43
+ backgroundColor: "$blue500",
44
+ borderColor: "$blue500",
45
+ color: "white",
46
+ },
47
+
48
+ "& > span:last-of-type": {
49
+ display: "none",
50
+ },
51
+
52
+ "&:not(:first-of-type)::before": {
53
+ content: '""',
54
+ position: "absolute",
55
+ top: "50%",
56
+ right: "calc(100% + 4px)",
57
+ transform: "translateY(-50%)",
58
+ width: "32px",
59
+ height: "8px",
60
+ borderRadius: "$sm",
61
+ backgroundColor: "$neutral50",
62
+ zIndex: 0,
63
+ },
64
+
65
+ '&[data-state="active"]::before': {
66
+ backgroundColor: "$blue500",
67
+ },
68
+
69
+ '&[data-filled="true"] > span:first-of-type': {
70
+ backgroundColor: "$blue500",
71
+ borderColor: "$blue500",
72
+ color: "white",
73
+ },
74
+
75
+ '&[data-filled="true"]::before': {
76
+ backgroundColor: "$blue500",
77
+ },
78
+ });
79
+
80
+ const StepListStyled = styled(StepRadix.List, {
81
+ display: "flex",
82
+ alignItems: "center",
83
+ justifyContent: "flex-start",
84
+ gap: "$4",
85
+ });
86
+
87
+ export type StepProps = ComponentProps<typeof StepStyled> & {
88
+ children: React.ReactNode;
89
+ defaultValue: number;
90
+ };
91
+ export function Step({ children, defaultValue, ...props }: StepProps) {
92
+ return (
93
+ <StepRadix.Root defaultValue={String(defaultValue)}>
94
+ <StepStyled {...props}>{children}</StepStyled>
95
+ </StepRadix.Root>
96
+ );
97
+ }
98
+
99
+ export function StepTrigger({
100
+ value,
101
+ children,
102
+ currentStep,
103
+ ...props
104
+ }: {
105
+ value: number;
106
+ children: React.ReactNode | string;
107
+ currentStep?: number;
108
+ onClick: () => void;
109
+ }) {
110
+ const isActiveOrPrevious = currentStep !== undefined && value <= currentStep;
111
+ return (
112
+ <StepTriggerStyled
113
+ data-filled={isActiveOrPrevious}
114
+ value={String(value)}
115
+ {...props}
116
+ >
117
+ {children}
118
+ </StepTriggerStyled>
119
+ );
120
+ }
121
+
122
+ export function StepContent({
123
+ value,
124
+ children,
125
+ ...props
126
+ }: {
127
+ value: number;
128
+ children: React.ReactNode;
129
+ }) {
130
+ return (
131
+ <StepRadix.Content value={String(value)} {...props}>
132
+ {children}
133
+ </StepRadix.Content>
134
+ );
135
+ }
136
+
137
+ export function StepList({
138
+ children,
139
+ currentStep,
140
+ ...props
141
+ }: {
142
+ children: React.ReactNode;
143
+ currentStep: number;
144
+ }) {
145
+ return (
146
+ <StepListStyled {...props}>
147
+ {React.Children.map(children, (child) => {
148
+ if (React.isValidElement(child) && child.type === StepTrigger) {
149
+ return React.cloneElement(child, { currentStep } as any);
150
+ }
151
+ return child;
152
+ })}
153
+ </StepListStyled>
154
+ );
155
+ }
156
+
157
+ export function StepWrapper({
158
+ children,
159
+ ...props
160
+ }: {
161
+ children: React.ReactNode;
162
+ }) {
163
+ return <Box {...props}>{children}</Box>;
164
+ }
@@ -1,109 +1,109 @@
1
- import { Switch as RadixSwitch } from '@radix-ui/themes'
2
- import type { ComponentProps } from 'react'
3
- import { styled } from '../styles'
4
-
5
- export const SwitchStyled = styled(RadixSwitch, {
6
- all: 'unset',
7
- borderRadius: '$full',
8
- position: 'relative',
9
- display: 'flex',
10
- alignItems: 'center',
11
- justifyContent: 'center',
12
- transition: 'all 0.3s',
13
- cursor: 'pointer',
14
-
15
- '&::before': {
16
- content: '""',
17
- position: 'absolute',
18
- borderRadius: '$full',
19
- pointerEvents: 'none',
20
- cursor: 'pointer',
21
- },
22
- 'span': {
23
- position: 'absolute',
24
- top: '50%',
25
- left: 0,
26
- transform: 'translate(0, -50%)',
27
- borderRadius: '50%',
28
- transition: 'all 0.3s',
29
- cursor: 'pointer',
30
- borderWidth: '1px',
31
- borderStyle: 'solid',
32
- boxShadow: '0px 0px 4px 0px rgba(0, 0, 0, 0.24)',
33
- },
34
-
35
- '&[data-state="checked"] span': {
36
- left: 'auto',
37
- transform: 'translate(50%, -50%)',
38
- },
39
-
40
- variants: {
41
- color: {
42
- brand: {
43
- '&::before': {
44
- backgroundColor: '$brand50',
45
- },
46
- 'span': {
47
- backgroundColor: '$dark50',
48
- borderColor: '$neutral300',
49
- },
50
- '&[data-state="checked"] span': {
51
- backgroundColor: '$brand500',
52
- borderColor: '$brand500',
53
- },
54
- }
55
- },
56
- size: {
57
- sm: {
58
- width: '32px',
59
- height: '20px',
60
- '&::before': {
61
- width: '$32',
62
- height: '$12',
63
- },
64
-
65
- 'span': {
66
- width: '$20',
67
- height: '$20',
68
- },
69
- },
70
- md: {
71
- width: '40px',
72
- height: '20px',
73
- '&::before': {
74
- width: '40px',
75
- height: '16px',
76
- },
77
- 'span': {
78
- width: '24px',
79
- height: '24px',
80
- },
81
- },
82
- lg: {
83
- width: '56px',
84
- height: '32px',
85
- '&::before': {
86
- width: '56px',
87
- height: '24px',
88
- },
89
- 'span': {
90
- width: '32px',
91
- height: '32px',
92
- },
93
- },
94
- },
95
- },
96
- defaultVariants: {
97
- size: 'md',
98
- color: 'brand',
99
- },
100
-
101
- })
102
- export type SwitchProps = ComponentProps<typeof RadixSwitch> & {
103
- color?: 'brand'
104
- size?: 'sm' | 'md' | 'lg'
105
- }
106
-
107
- export function Switch(props: SwitchProps) {
108
- return <SwitchStyled color="brand" defaultChecked {...props} />
1
+ import { Switch as RadixSwitch } from '@radix-ui/themes'
2
+ import type { ComponentProps } from 'react'
3
+ import { styled } from '../styles'
4
+
5
+ export const SwitchStyled = styled(RadixSwitch, {
6
+ all: 'unset',
7
+ borderRadius: '$full',
8
+ position: 'relative',
9
+ display: 'flex',
10
+ alignItems: 'center',
11
+ justifyContent: 'center',
12
+ transition: 'all 0.3s',
13
+ cursor: 'pointer',
14
+
15
+ '&::before': {
16
+ content: '""',
17
+ position: 'absolute',
18
+ borderRadius: '$full',
19
+ pointerEvents: 'none',
20
+ cursor: 'pointer',
21
+ },
22
+ 'span': {
23
+ position: 'absolute',
24
+ top: '50%',
25
+ left: 0,
26
+ transform: 'translate(0, -50%)',
27
+ borderRadius: '50%',
28
+ transition: 'all 0.3s',
29
+ cursor: 'pointer',
30
+ borderWidth: '1px',
31
+ borderStyle: 'solid',
32
+ boxShadow: '0px 0px 4px 0px rgba(0, 0, 0, 0.24)',
33
+ },
34
+
35
+ '&[data-state="checked"] span': {
36
+ left: 'auto',
37
+ transform: 'translate(50%, -50%)',
38
+ },
39
+
40
+ variants: {
41
+ color: {
42
+ brand: {
43
+ '&::before': {
44
+ backgroundColor: '$brand50',
45
+ },
46
+ 'span': {
47
+ backgroundColor: '$dark50',
48
+ borderColor: '$neutral300',
49
+ },
50
+ '&[data-state="checked"] span': {
51
+ backgroundColor: '$brand500',
52
+ borderColor: '$brand500',
53
+ },
54
+ }
55
+ },
56
+ size: {
57
+ sm: {
58
+ width: '32px',
59
+ height: '20px',
60
+ '&::before': {
61
+ width: '$32',
62
+ height: '$12',
63
+ },
64
+
65
+ 'span': {
66
+ width: '$20',
67
+ height: '$20',
68
+ },
69
+ },
70
+ md: {
71
+ width: '40px',
72
+ height: '20px',
73
+ '&::before': {
74
+ width: '40px',
75
+ height: '16px',
76
+ },
77
+ 'span': {
78
+ width: '24px',
79
+ height: '24px',
80
+ },
81
+ },
82
+ lg: {
83
+ width: '56px',
84
+ height: '32px',
85
+ '&::before': {
86
+ width: '56px',
87
+ height: '24px',
88
+ },
89
+ 'span': {
90
+ width: '32px',
91
+ height: '32px',
92
+ },
93
+ },
94
+ },
95
+ },
96
+ defaultVariants: {
97
+ size: 'md',
98
+ color: 'brand',
99
+ },
100
+
101
+ })
102
+ export type SwitchProps = ComponentProps<typeof RadixSwitch> & {
103
+ color?: 'brand'
104
+ size?: 'sm' | 'md' | 'lg'
105
+ }
106
+
107
+ export function Switch(props: SwitchProps) {
108
+ return <SwitchStyled color="brand" defaultChecked {...props} />
109
109
  }
@@ -1,38 +1,38 @@
1
- import { ComponentProps, ElementType } from "react";
2
- import { styled } from "../styles";
3
- import { Text as TextRadix } from "@radix-ui/themes";
4
- import { typographyValues } from "../types/typographyValues";
5
-
6
- import { colors, Colors } from "@lets-events/tokens";
7
-
8
- export const TextStyle = styled(TextRadix, {
9
- fontFamily: "$default",
10
- lineHeight: "$base",
11
- variants: {
12
- typography: typographyValues,
13
- fontWeight: {
14
- regular: { fontWeight: "$regular" },
15
- medium: { fontWeight: "$medium" },
16
- semibold: { fontWeight: "$semibold" },
17
- bold: { fontWeight: "$bold" },
18
- },
19
- },
20
- });
21
-
22
- export type TextProps = Omit<ComponentProps<typeof TextStyle>, "color"> & {
23
- as?: ElementType;
24
- asChild?: boolean;
25
- color?: keyof Colors;
26
- };
27
-
28
- export function Text({ color, ...props }: TextProps) {
29
- return (
30
- <TextStyle
31
- {...props}
32
- css={{
33
- color: color ? "$" + color : "$dark600",
34
- ...props.css,
35
- }}
36
- />
37
- );
38
- }
1
+ import { ComponentProps, ElementType } from "react";
2
+ import { styled } from "../styles";
3
+ import { Text as TextRadix } from "@radix-ui/themes";
4
+ import { typographyValues } from "../types/typographyValues";
5
+
6
+ import { colors, Colors } from "@lets-events/tokens";
7
+
8
+ export const TextStyle = styled(TextRadix, {
9
+ fontFamily: "$default",
10
+ lineHeight: "$base",
11
+ variants: {
12
+ typography: typographyValues,
13
+ fontWeight: {
14
+ regular: { fontWeight: "$regular" },
15
+ medium: { fontWeight: "$medium" },
16
+ semibold: { fontWeight: "$semibold" },
17
+ bold: { fontWeight: "$bold" },
18
+ },
19
+ },
20
+ });
21
+
22
+ export type TextProps = Omit<ComponentProps<typeof TextStyle>, "color"> & {
23
+ as?: ElementType;
24
+ asChild?: boolean;
25
+ color?: keyof Colors;
26
+ };
27
+
28
+ export function Text({ color, ...props }: TextProps) {
29
+ return (
30
+ <TextStyle
31
+ {...props}
32
+ css={{
33
+ color: color ? "$" + color : "$dark600",
34
+ ...props.css,
35
+ }}
36
+ />
37
+ );
38
+ }