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