@lets-events/react 12.9.3 → 12.10.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 (94) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +21 -19
  3. package/CHANGELOG.md +6 -0
  4. package/dist/index.d.mts +15 -2
  5. package/dist/index.d.ts +15 -2
  6. package/dist/index.js +296 -200
  7. package/dist/index.mjs +264 -169
  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 +123 -123
  12. package/src/components/Box.tsx +3 -3
  13. package/src/components/Button/index.tsx +74 -62
  14. package/src/components/Button/styledComponents.ts +361 -320
  15. package/src/components/ButtonGroup.tsx +484 -484
  16. package/src/components/Calendar/index.tsx +168 -168
  17. package/src/components/Calendar/styledComponents.ts +480 -480
  18. package/src/components/Card.tsx +67 -67
  19. package/src/components/CheckboxGroup.tsx +176 -176
  20. package/src/components/Container.tsx +39 -39
  21. package/src/components/Divider.tsx +7 -7
  22. package/src/components/DoubleCalendar/index.tsx +182 -182
  23. package/src/components/Drawer/index.tsx +100 -100
  24. package/src/components/Drawer/styledComponents.ts +103 -103
  25. package/src/components/Dropdown.tsx +302 -302
  26. package/src/components/Filter.tsx +164 -164
  27. package/src/components/Flex.tsx +118 -118
  28. package/src/components/FormFields/AddressFormFields/CityFormField.tsx +111 -111
  29. package/src/components/FormFields/AddressFormFields/CountryFormField.tsx +33 -33
  30. package/src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx +39 -39
  31. package/src/components/FormFields/AddressFormFields/StateFormField.tsx +32 -32
  32. package/src/components/FormFields/AddressFormFields/index.tsx +141 -141
  33. package/src/components/FormFields/BirthDateFormField.tsx +84 -84
  34. package/src/components/FormFields/CNPJFormField.tsx +87 -87
  35. package/src/components/FormFields/CPFFormField.tsx +78 -78
  36. package/src/components/FormFields/CalendarFormField.tsx +98 -98
  37. package/src/components/FormFields/CheckboxGroupFormField.tsx +91 -91
  38. package/src/components/FormFields/DateAndTimeFormField.tsx +217 -217
  39. package/src/components/FormFields/DoubleCalendarFormField.tsx +96 -96
  40. package/src/components/FormFields/EmailFormField.tsx +27 -27
  41. package/src/components/FormFields/Form.tsx +39 -39
  42. package/src/components/FormFields/IdentityDocumentNumberFormField.tsx +32 -32
  43. package/src/components/FormFields/MultiSelectFormField.tsx +64 -64
  44. package/src/components/FormFields/PhoneFormField.tsx +40 -40
  45. package/src/components/FormFields/RadioGroupFormField.tsx +86 -86
  46. package/src/components/FormFields/RichEditorFormField.tsx +103 -103
  47. package/src/components/FormFields/SelectFormField.tsx +113 -113
  48. package/src/components/FormFields/SwitchFormField.tsx +46 -46
  49. package/src/components/FormFields/TextAreaFormField.tsx +61 -61
  50. package/src/components/FormFields/TextFormField.tsx +112 -112
  51. package/src/components/FormFields/TimePickerFormField.tsx +88 -88
  52. package/src/components/FormFields/subComponents/ErrorFormMessage.tsx +36 -36
  53. package/src/components/FormFields/subComponents/FormLabel.tsx +36 -36
  54. package/src/components/FormFields/utils/validation.ts +23 -23
  55. package/src/components/Grid.tsx +137 -137
  56. package/src/components/Icon.tsx +47 -47
  57. package/src/components/MenuDropdown/index.tsx +38 -38
  58. package/src/components/MenuDropdown/styledComponents.ts +31 -31
  59. package/src/components/Modal.tsx +110 -110
  60. package/src/components/MultiSelect/index.tsx +305 -305
  61. package/src/components/MultiSelect/styledComponents.ts +160 -160
  62. package/src/components/RadioGroup.tsx +210 -210
  63. package/src/components/RichEditor/QuillComponent.tsx +468 -468
  64. package/src/components/RichEditor/RichEditor.tsx +49 -49
  65. package/src/components/RichEditor/RichTextPresenter.tsx +18 -18
  66. package/src/components/RichEditor/index.ts +3 -3
  67. package/src/components/RichEditor/styledComponents.ts +1170 -1170
  68. package/src/components/Section.tsx +33 -33
  69. package/src/components/Step.tsx +164 -164
  70. package/src/components/Switch.tsx +108 -108
  71. package/src/components/Text.tsx +38 -38
  72. package/src/components/TextField.tsx +372 -372
  73. package/src/components/TextareaField.tsx +116 -116
  74. package/src/components/TimePicker.tsx +357 -357
  75. package/src/components/Toast/components/ToastItem.tsx +41 -41
  76. package/src/components/Toast/components/ToastProvider.tsx +63 -63
  77. package/src/components/Toast/hooks/useToast.ts +12 -12
  78. package/src/components/Toast/index.tsx +5 -5
  79. package/src/components/Toast/styles/index.ts +135 -135
  80. package/src/components/Toast/types/index.ts +46 -46
  81. package/src/components/ToggleElement/index.tsx +58 -0
  82. package/src/components/Tooltip/index.tsx +73 -73
  83. package/src/components/Tooltip/styles.ts +77 -77
  84. package/src/hooks/useCountries.ts +41 -41
  85. package/src/hooks/useImageUpload.ts +139 -139
  86. package/src/hooks/useOnClickOutside.tsx +42 -42
  87. package/src/index.tsx +72 -72
  88. package/src/styles/index.ts +41 -41
  89. package/src/types/typographyValues.ts +178 -178
  90. package/src/utils/getNestedValue.ts +3 -3
  91. package/src/utils/states.ts +29 -29
  92. package/src/utils/uploadService.ts +180 -180
  93. package/tsconfig.json +3 -3
  94. package/tsup.config.ts +38 -38
@@ -1,305 +1,305 @@
1
- import React, { useCallback, useRef, useState } from "react";
2
- import { DropdownMenu, Theme } from "@radix-ui/themes";
3
- import { CheckboxGroup, CheckboxItem } from "../CheckboxGroup";
4
- import { Text } from "../Text";
5
- import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
6
- import {
7
- faChevronDown,
8
- faChevronUp,
9
- faSquareXmark,
10
- } from "@fortawesome/free-solid-svg-icons";
11
- import { colors } from "@lets-events/tokens";
12
- import { ComponentProps, useMemo } from "react";
13
- import { Flex } from "../Flex";
14
- import { Button } from "../Button";
15
- import { CloseBtnStyled, ButtonSelectAllStyled, itemStyle, StyledContent, StyledFlexSelectedItems, StyledFlexWithMaxHeight, StyledItem, StyledText, StyledTrigger } from "./styledComponents";
16
-
17
- export type MultiSelectProps = ComponentProps<typeof StyledTrigger> & {
18
- placeholder?: string;
19
- value?: string[];
20
- onValueChange?: (v: string[]) => void;
21
- options: Array<{
22
- label: string;
23
- value: string;
24
- }>;
25
- width?: string;
26
- zIndex?: string;
27
- showSelectedValues?: boolean;
28
- singleSelect?: boolean;
29
- selectedOrientation?: "row" | "column";
30
- disabled?: boolean;
31
- maxHeight?: string;
32
- selectedAllOptions?: boolean;
33
- selectedAllText?: string;
34
- selectedScroll?: boolean;
35
- showMoreButton?: boolean;
36
- showMoreButtonLabel?: string;
37
- showMoreButtonOnClick?: () => void;
38
- };
39
-
40
- export const MultiSelect = React.forwardRef<HTMLDivElement, MultiSelectProps>(
41
- (
42
- {
43
- placeholder,
44
- value: selectedValues = [],
45
- onValueChange,
46
- options,
47
- color,
48
- width = "100%",
49
- zIndex = "auto",
50
- showSelectedValues = true,
51
- singleSelect = false,
52
- selectedOrientation = "column",
53
- disabled = false,
54
- maxHeight,
55
- selectedAllOptions = false,
56
- selectedAllText,
57
- selectedScroll = false,
58
- showMoreButton = false,
59
- showMoreButtonLabel = "Carregar mais",
60
- showMoreButtonOnClick
61
- },
62
- fowardedRef
63
- ) => {
64
- const [isOpen, setIsOpen] = useState(false);
65
- const triggerRef = useRef<HTMLDivElement>(null);
66
- const [allOptionsSelected, setAllOptionsSelected] = useState(false)
67
- const labelByValue = useMemo(() => {
68
- return options.reduce<{ [key: string]: string }>((prev, curr) => {
69
- return {
70
- ...prev,
71
- [curr.value]: curr.label,
72
- };
73
- }, {});
74
- }, [options]);
75
-
76
- const handleRemove = useCallback(
77
- (value: string) => {
78
- const newValue = selectedValues.filter((v) => v !== value);
79
- onValueChange?.(newValue);
80
- },
81
- [selectedValues, onValueChange]
82
- );
83
-
84
- const handleSelectAll = useCallback(
85
- (e: React.MouseEvent) => {
86
- e.preventDefault();
87
- e.stopPropagation();
88
- const allSelected = selectedValues.length === options.length;
89
- if (allSelected) {
90
- onValueChange?.([]);
91
- setAllOptionsSelected(false)
92
- } else {
93
- onValueChange?.(options.map((o) => o.value));
94
- setAllOptionsSelected(true)
95
- }
96
- },
97
- [selectedValues, options, onValueChange]
98
- );
99
-
100
- const text = useMemo(() => {
101
- if (selectedValues.length > 0 && singleSelect) {
102
- const value = selectedValues[0];
103
- return labelByValue[value];
104
- }
105
- return placeholder ?? "Selecione";
106
- }, [selectedValues, placeholder, singleSelect]);
107
-
108
- const handleItemClick = (v: string) => {
109
- onValueChange?.([v]);
110
- setIsOpen(false);
111
- };
112
-
113
- const handleToggle = useCallback(
114
- (e: React.MouseEvent) => {
115
- e.preventDefault();
116
- e.stopPropagation();
117
- if (disabled) return;
118
- setIsOpen((prev) => !prev);
119
- },
120
- [disabled]
121
- );
122
-
123
- return (
124
- <Theme style={width !== "100%" ? { width } : undefined}>
125
- <DropdownMenu.Root open={isOpen} onOpenChange={setIsOpen}>
126
- <DropdownMenu.Trigger>
127
- <StyledTrigger
128
- ref={(r) => {
129
- if (!r) return;
130
- triggerRef.current = r;
131
- if (fowardedRef) {
132
- if (typeof fowardedRef === "function") fowardedRef(r);
133
- else fowardedRef.current = r;
134
- }
135
- }}
136
- color={color}
137
- disabled={disabled}
138
- style={width !== "100%" ? { width } : undefined}
139
- onClick={handleToggle}
140
- >
141
- <StyledText
142
- typography={"labelMedium"}
143
- color={disabled ? "dark400" : undefined}
144
- >
145
- {text}
146
- </StyledText>
147
- <FontAwesomeIcon
148
- icon={isOpen ? faChevronUp : faChevronDown}
149
- size="sm"
150
- color={disabled ? colors.dark400 : colors.dark600}
151
- />
152
- </StyledTrigger>
153
- </DropdownMenu.Trigger>
154
- <StyledContent
155
- css={{
156
- width: "100%",
157
- zIndex: zIndex === "auto" ? 999999 : zIndex,
158
- }}
159
- >
160
- {!singleSelect ? (
161
- <CheckboxGroup
162
- value={selectedValues}
163
- onValueChange={(v) => {
164
- onValueChange?.(v);
165
- setAllOptionsSelected((v || []).length === options.length);
166
- }}
167
- >
168
- <StyledFlexWithMaxHeight
169
- direction={"column"}
170
- gap={8}
171
- hasMaxHeight={!!maxHeight}
172
- style={maxHeight ? { maxHeight } : undefined}
173
- >
174
- {selectedAllOptions && (
175
- <ButtonSelectAllStyled
176
- css={itemStyle}
177
- onClick={(e) => { handleSelectAll(e), setIsOpen(false) }}
178
- type="button"
179
- >
180
- <div className={allOptionsSelected ? "checked" : ""}></div>
181
- <Text typography="labelSmall">
182
- {selectedAllText ? selectedAllText : "Selecionar Todos"}
183
- </Text>
184
- </ButtonSelectAllStyled>
185
- )}
186
-
187
- {options.map(({ value, label }, i) => (
188
- <CheckboxItem value={value} css={itemStyle} key={i}>
189
- <Text typography={"labelSmall"}>{label}</Text>
190
- </CheckboxItem>
191
- ))}
192
- {showMoreButton && showMoreButtonOnClick && (
193
- <Button
194
- variant="menuDropdownItem"
195
- color="brand"
196
- onClick={showMoreButtonOnClick}
197
- fontWeight="semibold"
198
- type="button"
199
- css={{
200
- justifyContent: "flex-start",
201
- color: "var(--colors-brand500)!important",
202
- }}
203
- >
204
- {showMoreButtonLabel}
205
- </Button>
206
- )}
207
- </StyledFlexWithMaxHeight>
208
- </CheckboxGroup>
209
- ) : (
210
- <StyledFlexWithMaxHeight
211
- direction={"column"}
212
- gap={8}
213
- hasMaxHeight={!!maxHeight}
214
- style={maxHeight ? { maxHeight } : undefined}
215
- >
216
- {options.map(({ value, label }, i) => (
217
- <StyledItem key={i} onClick={() => handleItemClick(value)}>
218
- <Text typography={"labelSmall"}>{label}</Text>
219
- </StyledItem>
220
- ))}
221
- {showMoreButton && showMoreButtonOnClick && (
222
- <Button
223
- variant="menuDropdownItem"
224
- color="brand"
225
- onClick={showMoreButtonOnClick}
226
- fontWeight="semibold"
227
- type="button"
228
- css={{
229
- justifyContent: "flex-start",
230
- color: "var(--colors-brand500)!important",
231
- }}
232
- >
233
- {showMoreButtonLabel}
234
- </Button>
235
- )}
236
- </StyledFlexWithMaxHeight>
237
- )}
238
- </StyledContent>
239
- </DropdownMenu.Root>
240
- {selectedValues.length > 0 && showSelectedValues && (
241
- <StyledFlexSelectedItems
242
- direction={selectedOrientation}
243
- gap={8}
244
- align={selectedOrientation === "column" ? "start" : "center"}
245
- justify={"start"}
246
- css={{ ...(selectedScroll && { maxHeight: maxHeight || "400px" }) }}
247
- >
248
- {allOptionsSelected ? (
249
- <Flex
250
- key="all-selected"
251
- gap={4}
252
- align={"center"}
253
- css={{ flexWrap: "wrap" }}
254
- >
255
- <CloseBtnStyled
256
- onClick={(e) => {
257
- e.stopPropagation();
258
- onValueChange?.([]);
259
- setAllOptionsSelected(false);
260
- }}
261
- type="button"
262
- >
263
- <FontAwesomeIcon icon={faSquareXmark} size="sm" />
264
- </CloseBtnStyled>
265
- <Text
266
- typography={"captionMedium"}
267
- fontWeight={"regular"}
268
- color="dark600"
269
- >
270
- {"Todos selecionados"}
271
- </Text>
272
- </Flex>
273
- ) : (
274
- selectedValues.map((value) => (
275
- <Flex
276
- key={value}
277
- gap={4}
278
- align={"center"}
279
- css={{ flexWrap: "wrap" }}
280
- >
281
- <CloseBtnStyled
282
- onClick={(e) => {
283
- e.stopPropagation();
284
- handleRemove(value);
285
- }}
286
- type="button"
287
- >
288
- <FontAwesomeIcon icon={faSquareXmark} size="sm" />
289
- </CloseBtnStyled>
290
- <Text
291
- typography={"captionMedium"}
292
- fontWeight={"regular"}
293
- color="dark600"
294
- >
295
- {labelByValue[value]}
296
- </Text>
297
- </Flex>
298
- ))
299
- )}
300
- </StyledFlexSelectedItems>
301
- )}
302
- </Theme>
303
- );
304
- }
305
- );
1
+ import React, { useCallback, useRef, useState } from "react";
2
+ import { DropdownMenu, Theme } from "@radix-ui/themes";
3
+ import { CheckboxGroup, CheckboxItem } from "../CheckboxGroup";
4
+ import { Text } from "../Text";
5
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
6
+ import {
7
+ faChevronDown,
8
+ faChevronUp,
9
+ faSquareXmark,
10
+ } from "@fortawesome/free-solid-svg-icons";
11
+ import { colors } from "@lets-events/tokens";
12
+ import { ComponentProps, useMemo } from "react";
13
+ import { Flex } from "../Flex";
14
+ import { Button } from "../Button";
15
+ import { CloseBtnStyled, ButtonSelectAllStyled, itemStyle, StyledContent, StyledFlexSelectedItems, StyledFlexWithMaxHeight, StyledItem, StyledText, StyledTrigger } from "./styledComponents";
16
+
17
+ export type MultiSelectProps = ComponentProps<typeof StyledTrigger> & {
18
+ placeholder?: string;
19
+ value?: string[];
20
+ onValueChange?: (v: string[]) => void;
21
+ options: Array<{
22
+ label: string;
23
+ value: string;
24
+ }>;
25
+ width?: string;
26
+ zIndex?: string;
27
+ showSelectedValues?: boolean;
28
+ singleSelect?: boolean;
29
+ selectedOrientation?: "row" | "column";
30
+ disabled?: boolean;
31
+ maxHeight?: string;
32
+ selectedAllOptions?: boolean;
33
+ selectedAllText?: string;
34
+ selectedScroll?: boolean;
35
+ showMoreButton?: boolean;
36
+ showMoreButtonLabel?: string;
37
+ showMoreButtonOnClick?: () => void;
38
+ };
39
+
40
+ export const MultiSelect = React.forwardRef<HTMLDivElement, MultiSelectProps>(
41
+ (
42
+ {
43
+ placeholder,
44
+ value: selectedValues = [],
45
+ onValueChange,
46
+ options,
47
+ color,
48
+ width = "100%",
49
+ zIndex = "auto",
50
+ showSelectedValues = true,
51
+ singleSelect = false,
52
+ selectedOrientation = "column",
53
+ disabled = false,
54
+ maxHeight,
55
+ selectedAllOptions = false,
56
+ selectedAllText,
57
+ selectedScroll = false,
58
+ showMoreButton = false,
59
+ showMoreButtonLabel = "Carregar mais",
60
+ showMoreButtonOnClick
61
+ },
62
+ fowardedRef
63
+ ) => {
64
+ const [isOpen, setIsOpen] = useState(false);
65
+ const triggerRef = useRef<HTMLDivElement>(null);
66
+ const [allOptionsSelected, setAllOptionsSelected] = useState(false)
67
+ const labelByValue = useMemo(() => {
68
+ return options.reduce<{ [key: string]: string }>((prev, curr) => {
69
+ return {
70
+ ...prev,
71
+ [curr.value]: curr.label,
72
+ };
73
+ }, {});
74
+ }, [options]);
75
+
76
+ const handleRemove = useCallback(
77
+ (value: string) => {
78
+ const newValue = selectedValues.filter((v) => v !== value);
79
+ onValueChange?.(newValue);
80
+ },
81
+ [selectedValues, onValueChange]
82
+ );
83
+
84
+ const handleSelectAll = useCallback(
85
+ (e: React.MouseEvent) => {
86
+ e.preventDefault();
87
+ e.stopPropagation();
88
+ const allSelected = selectedValues.length === options.length;
89
+ if (allSelected) {
90
+ onValueChange?.([]);
91
+ setAllOptionsSelected(false)
92
+ } else {
93
+ onValueChange?.(options.map((o) => o.value));
94
+ setAllOptionsSelected(true)
95
+ }
96
+ },
97
+ [selectedValues, options, onValueChange]
98
+ );
99
+
100
+ const text = useMemo(() => {
101
+ if (selectedValues.length > 0 && singleSelect) {
102
+ const value = selectedValues[0];
103
+ return labelByValue[value];
104
+ }
105
+ return placeholder ?? "Selecione";
106
+ }, [selectedValues, placeholder, singleSelect]);
107
+
108
+ const handleItemClick = (v: string) => {
109
+ onValueChange?.([v]);
110
+ setIsOpen(false);
111
+ };
112
+
113
+ const handleToggle = useCallback(
114
+ (e: React.MouseEvent) => {
115
+ e.preventDefault();
116
+ e.stopPropagation();
117
+ if (disabled) return;
118
+ setIsOpen((prev) => !prev);
119
+ },
120
+ [disabled]
121
+ );
122
+
123
+ return (
124
+ <Theme style={width !== "100%" ? { width } : undefined}>
125
+ <DropdownMenu.Root open={isOpen} onOpenChange={setIsOpen}>
126
+ <DropdownMenu.Trigger>
127
+ <StyledTrigger
128
+ ref={(r) => {
129
+ if (!r) return;
130
+ triggerRef.current = r;
131
+ if (fowardedRef) {
132
+ if (typeof fowardedRef === "function") fowardedRef(r);
133
+ else fowardedRef.current = r;
134
+ }
135
+ }}
136
+ color={color}
137
+ disabled={disabled}
138
+ style={width !== "100%" ? { width } : undefined}
139
+ onClick={handleToggle}
140
+ >
141
+ <StyledText
142
+ typography={"labelMedium"}
143
+ color={disabled ? "dark400" : undefined}
144
+ >
145
+ {text}
146
+ </StyledText>
147
+ <FontAwesomeIcon
148
+ icon={isOpen ? faChevronUp : faChevronDown}
149
+ size="sm"
150
+ color={disabled ? colors.dark400 : colors.dark600}
151
+ />
152
+ </StyledTrigger>
153
+ </DropdownMenu.Trigger>
154
+ <StyledContent
155
+ css={{
156
+ width: "100%",
157
+ zIndex: zIndex === "auto" ? 999999 : zIndex,
158
+ }}
159
+ >
160
+ {!singleSelect ? (
161
+ <CheckboxGroup
162
+ value={selectedValues}
163
+ onValueChange={(v) => {
164
+ onValueChange?.(v);
165
+ setAllOptionsSelected((v || []).length === options.length);
166
+ }}
167
+ >
168
+ <StyledFlexWithMaxHeight
169
+ direction={"column"}
170
+ gap={8}
171
+ hasMaxHeight={!!maxHeight}
172
+ style={maxHeight ? { maxHeight } : undefined}
173
+ >
174
+ {selectedAllOptions && (
175
+ <ButtonSelectAllStyled
176
+ css={itemStyle}
177
+ onClick={(e) => { handleSelectAll(e), setIsOpen(false) }}
178
+ type="button"
179
+ >
180
+ <div className={allOptionsSelected ? "checked" : ""}></div>
181
+ <Text typography="labelSmall">
182
+ {selectedAllText ? selectedAllText : "Selecionar Todos"}
183
+ </Text>
184
+ </ButtonSelectAllStyled>
185
+ )}
186
+
187
+ {options.map(({ value, label }, i) => (
188
+ <CheckboxItem value={value} css={itemStyle} key={i}>
189
+ <Text typography={"labelSmall"}>{label}</Text>
190
+ </CheckboxItem>
191
+ ))}
192
+ {showMoreButton && showMoreButtonOnClick && (
193
+ <Button
194
+ variant="menuDropdownItem"
195
+ color="brand"
196
+ onClick={showMoreButtonOnClick}
197
+ fontWeight="semibold"
198
+ type="button"
199
+ css={{
200
+ justifyContent: "flex-start",
201
+ color: "var(--colors-brand500)!important",
202
+ }}
203
+ >
204
+ {showMoreButtonLabel}
205
+ </Button>
206
+ )}
207
+ </StyledFlexWithMaxHeight>
208
+ </CheckboxGroup>
209
+ ) : (
210
+ <StyledFlexWithMaxHeight
211
+ direction={"column"}
212
+ gap={8}
213
+ hasMaxHeight={!!maxHeight}
214
+ style={maxHeight ? { maxHeight } : undefined}
215
+ >
216
+ {options.map(({ value, label }, i) => (
217
+ <StyledItem key={i} onClick={() => handleItemClick(value)}>
218
+ <Text typography={"labelSmall"}>{label}</Text>
219
+ </StyledItem>
220
+ ))}
221
+ {showMoreButton && showMoreButtonOnClick && (
222
+ <Button
223
+ variant="menuDropdownItem"
224
+ color="brand"
225
+ onClick={showMoreButtonOnClick}
226
+ fontWeight="semibold"
227
+ type="button"
228
+ css={{
229
+ justifyContent: "flex-start",
230
+ color: "var(--colors-brand500)!important",
231
+ }}
232
+ >
233
+ {showMoreButtonLabel}
234
+ </Button>
235
+ )}
236
+ </StyledFlexWithMaxHeight>
237
+ )}
238
+ </StyledContent>
239
+ </DropdownMenu.Root>
240
+ {selectedValues.length > 0 && showSelectedValues && (
241
+ <StyledFlexSelectedItems
242
+ direction={selectedOrientation}
243
+ gap={8}
244
+ align={selectedOrientation === "column" ? "start" : "center"}
245
+ justify={"start"}
246
+ css={{ ...(selectedScroll && { maxHeight: maxHeight || "400px" }) }}
247
+ >
248
+ {allOptionsSelected ? (
249
+ <Flex
250
+ key="all-selected"
251
+ gap={4}
252
+ align={"center"}
253
+ css={{ flexWrap: "wrap" }}
254
+ >
255
+ <CloseBtnStyled
256
+ onClick={(e) => {
257
+ e.stopPropagation();
258
+ onValueChange?.([]);
259
+ setAllOptionsSelected(false);
260
+ }}
261
+ type="button"
262
+ >
263
+ <FontAwesomeIcon icon={faSquareXmark} size="sm" />
264
+ </CloseBtnStyled>
265
+ <Text
266
+ typography={"captionMedium"}
267
+ fontWeight={"regular"}
268
+ color="dark600"
269
+ >
270
+ {"Todos selecionados"}
271
+ </Text>
272
+ </Flex>
273
+ ) : (
274
+ selectedValues.map((value) => (
275
+ <Flex
276
+ key={value}
277
+ gap={4}
278
+ align={"center"}
279
+ css={{ flexWrap: "wrap" }}
280
+ >
281
+ <CloseBtnStyled
282
+ onClick={(e) => {
283
+ e.stopPropagation();
284
+ handleRemove(value);
285
+ }}
286
+ type="button"
287
+ >
288
+ <FontAwesomeIcon icon={faSquareXmark} size="sm" />
289
+ </CloseBtnStyled>
290
+ <Text
291
+ typography={"captionMedium"}
292
+ fontWeight={"regular"}
293
+ color="dark600"
294
+ >
295
+ {labelByValue[value]}
296
+ </Text>
297
+ </Flex>
298
+ ))
299
+ )}
300
+ </StyledFlexSelectedItems>
301
+ )}
302
+ </Theme>
303
+ );
304
+ }
305
+ );