@lets-events/react 12.2.4 → 12.2.6

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 (89) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +21 -19
  3. package/CHANGELOG.md +12 -0
  4. package/dist/index.d.mts +5 -2
  5. package/dist/index.d.ts +5 -2
  6. package/dist/index.js +23 -3
  7. package/dist/index.mjs +23 -3
  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 -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 +300 -300
  15. package/src/components/ButtonGroup.tsx +484 -484
  16. package/src/components/Calendar/index.tsx +146 -146
  17. package/src/components/Calendar/styledComponents.ts +250 -250
  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 +138 -138
  22. package/src/components/Drawer/styledComponents.ts +52 -52
  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 +92 -92
  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 +32 -32
  39. package/src/components/FormFields/MultiSelectFormField.tsx +64 -64
  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 +102 -98
  43. package/src/components/FormFields/SelectFormField.tsx +93 -93
  44. package/src/components/FormFields/SwitchFormField.tsx +46 -46
  45. package/src/components/FormFields/TextAreaFormField.tsx +57 -57
  46. package/src/components/FormFields/TextFormField.tsx +112 -112
  47. package/src/components/FormFields/TimePickerFormField.tsx +88 -88
  48. package/src/components/FormFields/subComponents/ErrorFormMessage.tsx +36 -36
  49. package/src/components/FormFields/subComponents/FormLabel.tsx +29 -29
  50. package/src/components/FormFields/utils/validation.ts +23 -23
  51. package/src/components/Grid.tsx +137 -137
  52. package/src/components/Icon.tsx +47 -47
  53. package/src/components/MenuDropdown/index.tsx +38 -38
  54. package/src/components/MenuDropdown/styledComponents.ts +31 -31
  55. package/src/components/Modal.tsx +90 -90
  56. package/src/components/MultiSelect/index.tsx +243 -243
  57. package/src/components/MultiSelect/styledComponents.ts +160 -160
  58. package/src/components/RadioGroup.tsx +210 -210
  59. package/src/components/RichEditor/QuillComponent.tsx +458 -444
  60. package/src/components/RichEditor/RichEditor.tsx +49 -48
  61. package/src/components/RichEditor/index.ts +2 -2
  62. package/src/components/RichEditor/styledComponents.ts +1151 -1151
  63. package/src/components/Section.tsx +33 -33
  64. package/src/components/Step.tsx +164 -164
  65. package/src/components/Switch.tsx +108 -108
  66. package/src/components/Text.tsx +38 -38
  67. package/src/components/TextField.tsx +372 -372
  68. package/src/components/TextareaField.tsx +127 -127
  69. package/src/components/TimePicker.tsx +328 -328
  70. package/src/components/Toast/components/ToastItem.tsx +41 -41
  71. package/src/components/Toast/components/ToastProvider.tsx +63 -63
  72. package/src/components/Toast/hooks/useToast.ts +12 -12
  73. package/src/components/Toast/index.tsx +5 -5
  74. package/src/components/Toast/styles/index.ts +135 -135
  75. package/src/components/Toast/types/index.ts +46 -46
  76. package/src/components/Tooltip/index.tsx +66 -66
  77. package/src/components/Tooltip/styles.ts +77 -77
  78. package/src/hooks/useCountries.ts +41 -41
  79. package/src/hooks/useImageUpload.ts +139 -139
  80. package/src/hooks/useOnClickOutside.tsx +42 -42
  81. package/src/index.tsx +68 -68
  82. package/src/styles/index.ts +38 -38
  83. package/src/types/typographyValues.ts +178 -178
  84. package/src/utils/getNestedValue.ts +3 -3
  85. package/src/utils/states.ts +29 -29
  86. package/src/utils/uploadService.ts +180 -180
  87. package/tsconfig.json +3 -3
  88. package/tsup.config.ts +38 -38
  89. package/dist/index.css +0 -171
@@ -1,127 +1,127 @@
1
- import { TextArea as TextAreaRadix } from "@radix-ui/themes";
2
- import { styled } from "../styles";
3
- import React, { ComponentProps, useRef, useState, useEffect } from "react";
4
- import { typographyValues } from "../types/typographyValues";
5
- import { Text } from "./Text";
6
-
7
- export const TextareaFieldStyle = styled(TextAreaRadix, {
8
- display: "flex",
9
- flex: 1,
10
- textarea: {
11
- width: "100%",
12
- border: "none",
13
- padding: "$12 $14",
14
- fontFamily: "$default",
15
- outline: "none",
16
- resize: "vertical",
17
- height: "auto",
18
- },
19
- variants: {
20
- typography: typographyValues,
21
- },
22
- defaultVariants: {
23
- typography: "labelSmall",
24
- },
25
- });
26
-
27
- const TextareaContainer = styled("div", {
28
- display: "flex",
29
- flexDirection: "column",
30
- overflow: "hidden",
31
- width: "100%",
32
- border: "1px solid",
33
- borderRadius: "$sm",
34
-
35
- "&:has(textarea:focus)": {
36
- border: "1px solid $brand300",
37
- },
38
- "&:has(textarea:disabled)": {
39
- backgroundColor: "$dark100",
40
- color: "$dark400",
41
- border: "1px solid $dark200",
42
- cursor: "not-allowed",
43
- },
44
-
45
- variants: {
46
- color: {
47
- default: {
48
- borderColor: "$dark300",
49
- },
50
- error: {
51
- borderColor: "$error400",
52
- },
53
- },
54
- },
55
-
56
- defaultVariants: {
57
- color: "default",
58
- },
59
- });
60
-
61
- const TextareaLimitIndicator = styled("div", {
62
- padding: "$12 $16",
63
- borderTop: "1px solid $neutral300",
64
- width: "100%",
65
- flex: 1,
66
- display: "flex",
67
- backgroundColor: "$dark50",
68
- span: {
69
- backgroundColor: "$neutral200",
70
- color: "$neutral700",
71
- borderRadius: "$2xs",
72
- padding: "$4",
73
- },
74
- });
75
-
76
- export type TextareaFieldProps = Omit<
77
- ComponentProps<typeof TextareaFieldStyle>,
78
- "color"
79
- > &
80
- ComponentProps<typeof TextareaContainer>;
81
-
82
- export const TextareaField = React.forwardRef<
83
- HTMLTextAreaElement,
84
- TextareaFieldProps
85
- >(({ maxLength, color, ...props }, forwardedRef) => {
86
- const inputRef = useRef<HTMLTextAreaElement>(null);
87
- const [remaining, setRemaining] = useState(maxLength);
88
-
89
- useEffect(() => {
90
- if (maxLength && inputRef.current) {
91
- setRemaining(maxLength - (inputRef.current.value.length ?? 0));
92
- }
93
- }, [maxLength]);
94
-
95
- const handleInput = (e: React.FormEvent<HTMLTextAreaElement>) => {
96
- if (maxLength) {
97
- setRemaining(maxLength - e.currentTarget.value.length);
98
- }
99
- props.onInput?.(e);
100
- };
101
-
102
- return (
103
- <TextareaContainer color={color}>
104
- <TextareaFieldStyle
105
- rows={4}
106
- ref={(r) => {
107
- if (!r) return;
108
- inputRef.current = r;
109
- if (forwardedRef) {
110
- if (typeof forwardedRef === "function") forwardedRef(r);
111
- else forwardedRef.current = r;
112
- }
113
- }}
114
- onInput={handleInput}
115
- maxLength={maxLength}
116
- {...props}
117
- />
118
- {maxLength && (
119
- <TextareaLimitIndicator>
120
- <Text typography="badgeMedium">
121
- {remaining}
122
- </Text>
123
- </TextareaLimitIndicator>
124
- )}
125
- </TextareaContainer>
126
- );
127
- });
1
+ import { TextArea as TextAreaRadix } from "@radix-ui/themes";
2
+ import { styled } from "../styles";
3
+ import React, { ComponentProps, useRef, useState, useEffect } from "react";
4
+ import { typographyValues } from "../types/typographyValues";
5
+ import { Text } from "./Text";
6
+
7
+ export const TextareaFieldStyle = styled(TextAreaRadix, {
8
+ display: "flex",
9
+ flex: 1,
10
+ textarea: {
11
+ width: "100%",
12
+ border: "none",
13
+ padding: "$12 $14",
14
+ fontFamily: "$default",
15
+ outline: "none",
16
+ resize: "vertical",
17
+ height: "auto",
18
+ },
19
+ variants: {
20
+ typography: typographyValues,
21
+ },
22
+ defaultVariants: {
23
+ typography: "labelSmall",
24
+ },
25
+ });
26
+
27
+ const TextareaContainer = styled("div", {
28
+ display: "flex",
29
+ flexDirection: "column",
30
+ overflow: "hidden",
31
+ width: "100%",
32
+ border: "1px solid",
33
+ borderRadius: "$sm",
34
+
35
+ "&:has(textarea:focus)": {
36
+ border: "1px solid $brand300",
37
+ },
38
+ "&:has(textarea:disabled)": {
39
+ backgroundColor: "$dark100",
40
+ color: "$dark400",
41
+ border: "1px solid $dark200",
42
+ cursor: "not-allowed",
43
+ },
44
+
45
+ variants: {
46
+ color: {
47
+ default: {
48
+ borderColor: "$dark300",
49
+ },
50
+ error: {
51
+ borderColor: "$error400",
52
+ },
53
+ },
54
+ },
55
+
56
+ defaultVariants: {
57
+ color: "default",
58
+ },
59
+ });
60
+
61
+ const TextareaLimitIndicator = styled("div", {
62
+ padding: "$12 $16",
63
+ borderTop: "1px solid $neutral300",
64
+ width: "100%",
65
+ flex: 1,
66
+ display: "flex",
67
+ backgroundColor: "$dark50",
68
+ span: {
69
+ backgroundColor: "$neutral200",
70
+ color: "$neutral700",
71
+ borderRadius: "$2xs",
72
+ padding: "$4",
73
+ },
74
+ });
75
+
76
+ export type TextareaFieldProps = Omit<
77
+ ComponentProps<typeof TextareaFieldStyle>,
78
+ "color"
79
+ > &
80
+ ComponentProps<typeof TextareaContainer>;
81
+
82
+ export const TextareaField = React.forwardRef<
83
+ HTMLTextAreaElement,
84
+ TextareaFieldProps
85
+ >(({ maxLength, color, ...props }, forwardedRef) => {
86
+ const inputRef = useRef<HTMLTextAreaElement>(null);
87
+ const [remaining, setRemaining] = useState(maxLength);
88
+
89
+ useEffect(() => {
90
+ if (maxLength && inputRef.current) {
91
+ setRemaining(maxLength - (inputRef.current.value.length ?? 0));
92
+ }
93
+ }, [maxLength]);
94
+
95
+ const handleInput = (e: React.FormEvent<HTMLTextAreaElement>) => {
96
+ if (maxLength) {
97
+ setRemaining(maxLength - e.currentTarget.value.length);
98
+ }
99
+ props.onInput?.(e);
100
+ };
101
+
102
+ return (
103
+ <TextareaContainer color={color}>
104
+ <TextareaFieldStyle
105
+ rows={4}
106
+ ref={(r) => {
107
+ if (!r) return;
108
+ inputRef.current = r;
109
+ if (forwardedRef) {
110
+ if (typeof forwardedRef === "function") forwardedRef(r);
111
+ else forwardedRef.current = r;
112
+ }
113
+ }}
114
+ onInput={handleInput}
115
+ maxLength={maxLength}
116
+ {...props}
117
+ />
118
+ {maxLength && (
119
+ <TextareaLimitIndicator>
120
+ <Text typography="badgeMedium">
121
+ {remaining}
122
+ </Text>
123
+ </TextareaLimitIndicator>
124
+ )}
125
+ </TextareaContainer>
126
+ );
127
+ });