@lets-events/react 11.6.1 → 11.6.2

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 (75) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +18 -20
  3. package/CHANGELOG.md +6 -0
  4. package/dist/index.css +171 -0
  5. package/dist/index.d.mts +2 -1
  6. package/dist/index.d.ts +2 -1
  7. package/dist/index.js +83 -0
  8. package/dist/index.mjs +85 -2
  9. package/package.json +3 -2
  10. package/src/components/Alert.tsx +303 -303
  11. package/src/components/Avatar.tsx +55 -55
  12. package/src/components/Badge.tsx +125 -125
  13. package/src/components/Box.tsx +3 -3
  14. package/src/components/Button/index.tsx +16 -16
  15. package/src/components/Button/styledComponents.ts +287 -287
  16. package/src/components/ButtonGroup.tsx +484 -484
  17. package/src/components/Calendar/index.tsx +136 -136
  18. package/src/components/Calendar/styledComponents.ts +209 -209
  19. package/src/components/Card.tsx +48 -48
  20. package/src/components/CheckboxGroup.tsx +176 -176
  21. package/src/components/Container.tsx +39 -39
  22. package/src/components/Drawer/index.tsx +48 -48
  23. package/src/components/Drawer/styledComponents.ts +46 -46
  24. package/src/components/Dropdown.tsx +192 -192
  25. package/src/components/Filter.tsx +164 -164
  26. package/src/components/Flex.tsx +118 -118
  27. package/src/components/FormFields/AddressFormFields/CityFormField.tsx +111 -111
  28. package/src/components/FormFields/AddressFormFields/CountryFormField.tsx +33 -33
  29. package/src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx +45 -45
  30. package/src/components/FormFields/AddressFormFields/StateFormField.tsx +32 -32
  31. package/src/components/FormFields/AddressFormFields/index.tsx +139 -139
  32. package/src/components/FormFields/BirthDateFormField.tsx +87 -87
  33. package/src/components/FormFields/CNPJFormField.tsx +89 -89
  34. package/src/components/FormFields/CPFFormField.tsx +79 -79
  35. package/src/components/FormFields/CheckboxGroupFormField.tsx +90 -90
  36. package/src/components/FormFields/ErrorFormMessage.tsx +36 -36
  37. package/src/components/FormFields/Form.tsx +29 -29
  38. package/src/components/FormFields/FormLabel.tsx +29 -29
  39. package/src/components/FormFields/IdentityDocumentNumberFormField.tsx +42 -42
  40. package/src/components/FormFields/MultiSelectFormField.tsx +59 -59
  41. package/src/components/FormFields/PhoneFormField.tsx +130 -130
  42. package/src/components/FormFields/RadioGroupFormField.tsx +84 -84
  43. package/src/components/FormFields/SelectFormField.tsx +93 -93
  44. package/src/components/FormFields/TextAreaFormField.tsx +48 -48
  45. package/src/components/FormFields/TextFormField.tsx +76 -76
  46. package/src/components/Grid.tsx +137 -137
  47. package/src/components/Icon.tsx +47 -47
  48. package/src/components/MenuDropdown/index.tsx +30 -30
  49. package/src/components/MenuDropdown/styledComponents.ts +31 -31
  50. package/src/components/Modal.tsx +90 -90
  51. package/src/components/MultiSelect.tsx +218 -218
  52. package/src/components/RadioGroup.tsx +210 -210
  53. package/src/components/Section.tsx +33 -33
  54. package/src/components/Step.tsx +164 -164
  55. package/src/components/Switch.tsx +108 -108
  56. package/src/components/Text.tsx +38 -38
  57. package/src/components/TextField.tsx +312 -312
  58. package/src/components/TextareaField.tsx +128 -128
  59. package/src/components/TimePicker.tsx +298 -298
  60. package/src/components/Toast/components/ToastItem.tsx +41 -41
  61. package/src/components/Toast/components/ToastProvider.tsx +63 -63
  62. package/src/components/Toast/hooks/useToast.ts +12 -12
  63. package/src/components/Toast/index.tsx +5 -5
  64. package/src/components/Toast/styles/index.ts +135 -135
  65. package/src/components/Toast/types/index.ts +46 -46
  66. package/src/components/Tooltip/index.tsx +66 -66
  67. package/src/components/Tooltip/styles.ts +77 -77
  68. package/src/hooks/useCountries.ts +41 -41
  69. package/src/hooks/useOnClickOutside.tsx +20 -20
  70. package/src/index.tsx +52 -52
  71. package/src/styles/index.ts +38 -38
  72. package/src/types/typographyValues.ts +178 -178
  73. package/src/utils/getNestedValue.ts +3 -3
  74. package/src/utils/states.ts +29 -29
  75. package/tsconfig.json +3 -3
@@ -1,192 +1,192 @@
1
- import { useState, ComponentProps, ElementType } from "react";
2
- import { faChevronDown, faChevronUp } from "@fortawesome/free-solid-svg-icons";
3
- import { Theme, DropdownMenu as DropdownMenuRadix } from "@radix-ui/themes";
4
- import { typographyLabelValues } from "../types/typographyValues";
5
- import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
6
- import { colors } from "@lets-events/tokens";
7
- import { styled } from "../styles";
8
-
9
- const DropdownMenuItemStyled = styled(DropdownMenuRadix.Item, {
10
- fontFamily: "$default",
11
- color: "$dark600",
12
- letterSpacing: "0px",
13
- padding: "$8 $16",
14
- "&:hover, &:focus": {
15
- backgroundColor: "$dark100",
16
- border: "none",
17
- outline: "none",
18
- cursor: "pointer",
19
- },
20
- variants: {
21
- typography: typographyLabelValues,
22
- fontWeight: {
23
- regular: { fontWeight: "$regular" },
24
- medium: { fontWeight: "$medium" },
25
- semibold: { fontWeight: "$semibold" },
26
- bold: { fontWeight: "$bold" },
27
- },
28
- },
29
- });
30
-
31
- const DropdownMenuStyled = styled("div", {
32
- fontFamily: "$default",
33
- color: "$dark600",
34
- letterSpacing: "0px",
35
- cursor: "pointer",
36
- border: "1px solid $dark300",
37
- borderRadius: "$xs",
38
- padding: "$8 $12",
39
- width: "calc(100% - 24px)",
40
- display: "flex",
41
- button: {
42
- fontFamily: "$default",
43
- color: "$dark600",
44
- letterSpacing: "0px",
45
- backgroundColor: "transparent",
46
- border: "none",
47
- width: "100%",
48
- outline: "none",
49
- display: "flex",
50
- alignItems: "center",
51
- gap: "$8",
52
- cursor: "pointer",
53
- svg: {
54
- marginLeft: "auto",
55
- },
56
- },
57
- variants: {
58
- typography: {
59
- labelLarge: {
60
- button: {
61
- fontSize: "$labelLarge",
62
- lineHeight: "$labelLarge",
63
- },
64
- },
65
- labelMedium: {
66
- button: {
67
- fontSize: "$labelMedium",
68
- lineHeight: "$labelMedium",
69
- },
70
- },
71
- labelSmall: {
72
- button: {
73
- fontSize: "$labelSmall",
74
- lineHeight: "$labelSmall",
75
- },
76
- },
77
- labelExtraSmall: {
78
- button: {
79
- fontSize: "$labelExtraSmall",
80
- lineHeight: "$labelExtraSmall",
81
- },
82
- },
83
- },
84
- fontWeight: {
85
- regular: { button: { fontWeight: "$regular" } },
86
- medium: { button: { fontWeight: "$medium" } },
87
- semibold: { button: { fontWeight: "$semibold" } },
88
- bold: { button: { fontWeight: "$bold" } },
89
- },
90
- color: {
91
- default: {
92
- border: "1px solid $dark300",
93
- },
94
- error: {
95
- border: "1px solid $error400",
96
- },
97
- },
98
- },
99
- });
100
-
101
- const DropdownMenuContentStyled = styled(DropdownMenuRadix.Content, {
102
- background: "white",
103
- border: "1px solid $dark300",
104
- borderRadius: "$xs",
105
- boxShadow: "0px 4px 4px 0px rgba(35, 53, 67, 0.08)",
106
- width: "calc(var(--radix-popper-anchor-width) + 24px);",
107
- minWidth: "100%",
108
- marginTop: "3px",
109
- maxHeight: "400px",
110
- height: "100%",
111
- position: "relative",
112
- overflow: "auto",
113
- });
114
-
115
- export type DropdownMenuProps = ComponentProps<
116
- typeof DropdownMenuRadix.Root
117
- > & {
118
- as?: ElementType;
119
- placeholder?: string;
120
- fontWeight: "regular" | "medium" | "semibold" | "bold";
121
- typography: "labelExtraSmall" | "labelSmall" | "labelMedium" | "labelLarge";
122
- children: React.ReactNode;
123
- color?: "default" | "error";
124
- };
125
-
126
- export type DropdownMenuItemProps = ComponentProps<
127
- typeof DropdownMenuItemStyled
128
- > & {
129
- as?: ElementType;
130
- value: string;
131
- typography: DropdownMenuProps["typography"];
132
- fontWeight: DropdownMenuProps["fontWeight"];
133
- };
134
-
135
- /* Componente principal */
136
- export function DropdownMenu({
137
- children,
138
- placeholder,
139
- typography,
140
- color,
141
- fontWeight,
142
- ...props
143
- }: DropdownMenuProps) {
144
- const [isOpen, setIsOpen] = useState(false);
145
- return (
146
- <Theme>
147
- <DropdownMenuRadix.Root open={isOpen} onOpenChange={setIsOpen} {...props}>
148
- <DropdownMenuStyled
149
- typography={typography}
150
- fontWeight={fontWeight}
151
- color={color}
152
- >
153
- <DropdownMenuRadix.Trigger>
154
- <button aria-label={placeholder || "Filtrar"}>
155
- <span>{placeholder || "Filtrar"}</span>
156
- <FontAwesomeIcon
157
- icon={isOpen ? faChevronUp : faChevronDown}
158
- size="sm"
159
- color={colors.dark600}
160
- />
161
- </button>
162
- </DropdownMenuRadix.Trigger>
163
- <DropdownMenuContentStyled
164
- avoidCollisions={false}
165
- align="start"
166
- alignOffset={-14}
167
- >
168
- <DropdownMenuRadix.Group>{children}</DropdownMenuRadix.Group>
169
- </DropdownMenuContentStyled>
170
- </DropdownMenuStyled>
171
- </DropdownMenuRadix.Root>
172
- </Theme>
173
- );
174
- }
175
-
176
- /* Componente de item */
177
- export function DropdownMenuItem({
178
- children,
179
- typography,
180
- fontWeight,
181
- ...props
182
- }: DropdownMenuItemProps) {
183
- return (
184
- <DropdownMenuItemStyled
185
- typography={typography}
186
- fontWeight={fontWeight}
187
- {...props}
188
- >
189
- {children}
190
- </DropdownMenuItemStyled>
191
- );
192
- }
1
+ import { useState, ComponentProps, ElementType } from "react";
2
+ import { faChevronDown, faChevronUp } from "@fortawesome/free-solid-svg-icons";
3
+ import { Theme, DropdownMenu as DropdownMenuRadix } from "@radix-ui/themes";
4
+ import { typographyLabelValues } from "../types/typographyValues";
5
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
6
+ import { colors } from "@lets-events/tokens";
7
+ import { styled } from "../styles";
8
+
9
+ const DropdownMenuItemStyled = styled(DropdownMenuRadix.Item, {
10
+ fontFamily: "$default",
11
+ color: "$dark600",
12
+ letterSpacing: "0px",
13
+ padding: "$8 $16",
14
+ "&:hover, &:focus": {
15
+ backgroundColor: "$dark100",
16
+ border: "none",
17
+ outline: "none",
18
+ cursor: "pointer",
19
+ },
20
+ variants: {
21
+ typography: typographyLabelValues,
22
+ fontWeight: {
23
+ regular: { fontWeight: "$regular" },
24
+ medium: { fontWeight: "$medium" },
25
+ semibold: { fontWeight: "$semibold" },
26
+ bold: { fontWeight: "$bold" },
27
+ },
28
+ },
29
+ });
30
+
31
+ const DropdownMenuStyled = styled("div", {
32
+ fontFamily: "$default",
33
+ color: "$dark600",
34
+ letterSpacing: "0px",
35
+ cursor: "pointer",
36
+ border: "1px solid $dark300",
37
+ borderRadius: "$xs",
38
+ padding: "$8 $12",
39
+ width: "calc(100% - 24px)",
40
+ display: "flex",
41
+ button: {
42
+ fontFamily: "$default",
43
+ color: "$dark600",
44
+ letterSpacing: "0px",
45
+ backgroundColor: "transparent",
46
+ border: "none",
47
+ width: "100%",
48
+ outline: "none",
49
+ display: "flex",
50
+ alignItems: "center",
51
+ gap: "$8",
52
+ cursor: "pointer",
53
+ svg: {
54
+ marginLeft: "auto",
55
+ },
56
+ },
57
+ variants: {
58
+ typography: {
59
+ labelLarge: {
60
+ button: {
61
+ fontSize: "$labelLarge",
62
+ lineHeight: "$labelLarge",
63
+ },
64
+ },
65
+ labelMedium: {
66
+ button: {
67
+ fontSize: "$labelMedium",
68
+ lineHeight: "$labelMedium",
69
+ },
70
+ },
71
+ labelSmall: {
72
+ button: {
73
+ fontSize: "$labelSmall",
74
+ lineHeight: "$labelSmall",
75
+ },
76
+ },
77
+ labelExtraSmall: {
78
+ button: {
79
+ fontSize: "$labelExtraSmall",
80
+ lineHeight: "$labelExtraSmall",
81
+ },
82
+ },
83
+ },
84
+ fontWeight: {
85
+ regular: { button: { fontWeight: "$regular" } },
86
+ medium: { button: { fontWeight: "$medium" } },
87
+ semibold: { button: { fontWeight: "$semibold" } },
88
+ bold: { button: { fontWeight: "$bold" } },
89
+ },
90
+ color: {
91
+ default: {
92
+ border: "1px solid $dark300",
93
+ },
94
+ error: {
95
+ border: "1px solid $error400",
96
+ },
97
+ },
98
+ },
99
+ });
100
+
101
+ const DropdownMenuContentStyled = styled(DropdownMenuRadix.Content, {
102
+ background: "white",
103
+ border: "1px solid $dark300",
104
+ borderRadius: "$xs",
105
+ boxShadow: "0px 4px 4px 0px rgba(35, 53, 67, 0.08)",
106
+ width: "calc(var(--radix-popper-anchor-width) + 24px);",
107
+ minWidth: "100%",
108
+ marginTop: "3px",
109
+ maxHeight: "400px",
110
+ height: "100%",
111
+ position: "relative",
112
+ overflow: "auto",
113
+ });
114
+
115
+ export type DropdownMenuProps = ComponentProps<
116
+ typeof DropdownMenuRadix.Root
117
+ > & {
118
+ as?: ElementType;
119
+ placeholder?: string;
120
+ fontWeight: "regular" | "medium" | "semibold" | "bold";
121
+ typography: "labelExtraSmall" | "labelSmall" | "labelMedium" | "labelLarge";
122
+ children: React.ReactNode;
123
+ color?: "default" | "error";
124
+ };
125
+
126
+ export type DropdownMenuItemProps = ComponentProps<
127
+ typeof DropdownMenuItemStyled
128
+ > & {
129
+ as?: ElementType;
130
+ value: string;
131
+ typography: DropdownMenuProps["typography"];
132
+ fontWeight: DropdownMenuProps["fontWeight"];
133
+ };
134
+
135
+ /* Componente principal */
136
+ export function DropdownMenu({
137
+ children,
138
+ placeholder,
139
+ typography,
140
+ color,
141
+ fontWeight,
142
+ ...props
143
+ }: DropdownMenuProps) {
144
+ const [isOpen, setIsOpen] = useState(false);
145
+ return (
146
+ <Theme>
147
+ <DropdownMenuRadix.Root open={isOpen} onOpenChange={setIsOpen} {...props}>
148
+ <DropdownMenuStyled
149
+ typography={typography}
150
+ fontWeight={fontWeight}
151
+ color={color}
152
+ >
153
+ <DropdownMenuRadix.Trigger>
154
+ <button aria-label={placeholder || "Filtrar"}>
155
+ <span>{placeholder || "Filtrar"}</span>
156
+ <FontAwesomeIcon
157
+ icon={isOpen ? faChevronUp : faChevronDown}
158
+ size="sm"
159
+ color={colors.dark600}
160
+ />
161
+ </button>
162
+ </DropdownMenuRadix.Trigger>
163
+ <DropdownMenuContentStyled
164
+ avoidCollisions={false}
165
+ align="start"
166
+ alignOffset={-14}
167
+ >
168
+ <DropdownMenuRadix.Group>{children}</DropdownMenuRadix.Group>
169
+ </DropdownMenuContentStyled>
170
+ </DropdownMenuStyled>
171
+ </DropdownMenuRadix.Root>
172
+ </Theme>
173
+ );
174
+ }
175
+
176
+ /* Componente de item */
177
+ export function DropdownMenuItem({
178
+ children,
179
+ typography,
180
+ fontWeight,
181
+ ...props
182
+ }: DropdownMenuItemProps) {
183
+ return (
184
+ <DropdownMenuItemStyled
185
+ typography={typography}
186
+ fontWeight={fontWeight}
187
+ {...props}
188
+ >
189
+ {children}
190
+ </DropdownMenuItemStyled>
191
+ );
192
+ }