@lets-events/react 12.2.6 → 12.2.7

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 +19 -21
  3. package/CHANGELOG.md +6 -0
  4. package/dist/index.css +171 -0
  5. package/dist/index.js +1 -1
  6. package/dist/index.mjs +1 -1
  7. package/package.json +1 -1
  8. package/src/components/Alert.tsx +303 -303
  9. package/src/components/Avatar.tsx +55 -55
  10. package/src/components/Badge.tsx +125 -125
  11. package/src/components/Box.tsx +3 -3
  12. package/src/components/Button/index.tsx +16 -16
  13. package/src/components/Button/styledComponents.ts +300 -300
  14. package/src/components/ButtonGroup.tsx +484 -484
  15. package/src/components/Calendar/index.tsx +146 -146
  16. package/src/components/Calendar/styledComponents.ts +250 -250
  17. package/src/components/Card.tsx +48 -48
  18. package/src/components/CheckboxGroup.tsx +176 -176
  19. package/src/components/Container.tsx +39 -39
  20. package/src/components/Drawer/index.tsx +138 -138
  21. package/src/components/Drawer/styledComponents.ts +52 -52
  22. package/src/components/Dropdown.tsx +302 -302
  23. package/src/components/Filter.tsx +164 -164
  24. package/src/components/Flex.tsx +118 -118
  25. package/src/components/FormFields/AddressFormFields/CityFormField.tsx +111 -111
  26. package/src/components/FormFields/AddressFormFields/CountryFormField.tsx +33 -33
  27. package/src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx +39 -39
  28. package/src/components/FormFields/AddressFormFields/StateFormField.tsx +32 -32
  29. package/src/components/FormFields/AddressFormFields/index.tsx +141 -141
  30. package/src/components/FormFields/BirthDateFormField.tsx +84 -84
  31. package/src/components/FormFields/CNPJFormField.tsx +87 -87
  32. package/src/components/FormFields/CPFFormField.tsx +78 -78
  33. package/src/components/FormFields/CalendarFormField.tsx +92 -92
  34. package/src/components/FormFields/CheckboxGroupFormField.tsx +91 -91
  35. package/src/components/FormFields/EmailFormField.tsx +27 -27
  36. package/src/components/FormFields/Form.tsx +39 -39
  37. package/src/components/FormFields/IdentityDocumentNumberFormField.tsx +32 -32
  38. package/src/components/FormFields/MultiSelectFormField.tsx +64 -64
  39. package/src/components/FormFields/PhoneFormField.tsx +40 -40
  40. package/src/components/FormFields/RadioGroupFormField.tsx +84 -84
  41. package/src/components/FormFields/RichEditorFormField.tsx +102 -102
  42. package/src/components/FormFields/SelectFormField.tsx +93 -93
  43. package/src/components/FormFields/SwitchFormField.tsx +46 -46
  44. package/src/components/FormFields/TextAreaFormField.tsx +57 -57
  45. package/src/components/FormFields/TextFormField.tsx +112 -112
  46. package/src/components/FormFields/TimePickerFormField.tsx +88 -88
  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/index.tsx +243 -243
  56. package/src/components/MultiSelect/styledComponents.ts +160 -160
  57. package/src/components/RadioGroup.tsx +210 -210
  58. package/src/components/RichEditor/QuillComponent.tsx +458 -458
  59. package/src/components/RichEditor/RichEditor.tsx +49 -49
  60. package/src/components/RichEditor/index.ts +2 -2
  61. package/src/components/RichEditor/styledComponents.ts +1151 -1151
  62. package/src/components/Section.tsx +33 -33
  63. package/src/components/Step.tsx +164 -164
  64. package/src/components/Switch.tsx +108 -108
  65. package/src/components/Text.tsx +38 -38
  66. package/src/components/TextField.tsx +372 -372
  67. package/src/components/TextareaField.tsx +127 -127
  68. package/src/components/TimePicker.tsx +328 -328
  69. package/src/components/Toast/components/ToastItem.tsx +41 -41
  70. package/src/components/Toast/components/ToastProvider.tsx +63 -63
  71. package/src/components/Toast/hooks/useToast.ts +12 -12
  72. package/src/components/Toast/index.tsx +5 -5
  73. package/src/components/Toast/styles/index.ts +135 -135
  74. package/src/components/Toast/types/index.ts +46 -46
  75. package/src/components/Tooltip/index.tsx +66 -66
  76. package/src/components/Tooltip/styles.ts +77 -77
  77. package/src/hooks/useCountries.ts +41 -41
  78. package/src/hooks/useImageUpload.ts +139 -139
  79. package/src/hooks/useOnClickOutside.tsx +42 -42
  80. package/src/index.tsx +68 -68
  81. package/src/styles/index.ts +38 -38
  82. package/src/types/typographyValues.ts +178 -178
  83. package/src/utils/getNestedValue.ts +3 -3
  84. package/src/utils/states.ts +29 -29
  85. package/src/utils/uploadService.ts +180 -180
  86. package/tsconfig.json +3 -3
  87. package/tsup.config.ts +38 -38
@@ -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
+ });