@xqmsg/ui-core 0.22.4 → 0.23.1-rc.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 (40) hide show
  1. package/dist/components/form/FormTypes.d.ts +2 -0
  2. package/dist/components/input/StackedCheckbox/StackedCheckbox.d.ts +3 -2
  3. package/dist/components/input/StackedInput/StackedInput.d.ts +1 -0
  4. package/dist/components/input/StackedPilledInput/index.d.ts +2 -0
  5. package/dist/components/input/StackedTextarea/StackedTextarea.d.ts +3 -0
  6. package/dist/components/input/components/token/index.d.ts +1 -0
  7. package/dist/components/input/index.d.ts +3 -2
  8. package/dist/components/select/index.d.ts +27 -0
  9. package/dist/index.d.ts +1 -0
  10. package/dist/theme/components/button.d.ts +116 -0
  11. package/dist/theme/components/checkbox.d.ts +28 -0
  12. package/dist/theme/components/input.d.ts +12 -0
  13. package/dist/theme/components/select.d.ts +12 -0
  14. package/dist/theme/components/textarea.d.ts +66 -0
  15. package/dist/ui-core.cjs.development.js +328 -53
  16. package/dist/ui-core.cjs.development.js.map +1 -1
  17. package/dist/ui-core.cjs.production.min.js +1 -1
  18. package/dist/ui-core.cjs.production.min.js.map +1 -1
  19. package/dist/ui-core.esm.js +330 -56
  20. package/dist/ui-core.esm.js.map +1 -1
  21. package/package.json +1 -1
  22. package/src/components/button/Button.stories.tsx +92 -27
  23. package/src/components/form/FormTypes.ts +2 -0
  24. package/src/components/form/section/index.tsx +2 -0
  25. package/src/components/input/Input.stories.tsx +66 -0
  26. package/src/components/input/StackedCheckbox/StackedCheckbox.tsx +12 -4
  27. package/src/components/input/StackedInput/StackedInput.tsx +5 -0
  28. package/src/components/input/StackedPilledInput/index.tsx +286 -266
  29. package/src/components/input/StackedTextarea/StackedTextarea.tsx +29 -5
  30. package/src/components/input/components/dropdown/index.tsx +1 -1
  31. package/src/components/input/components/token/index.tsx +6 -5
  32. package/src/components/input/index.tsx +22 -9
  33. package/src/components/select/index.tsx +184 -0
  34. package/src/components/tabs/TabsWrapper.stories.tsx +1 -1
  35. package/src/index.tsx +3 -0
  36. package/src/theme/components/button.ts +67 -0
  37. package/src/theme/components/checkbox.ts +25 -0
  38. package/src/theme/components/input.ts +15 -1
  39. package/src/theme/components/textarea.ts +20 -0
  40. package/src/theme/customXQChakraTheme.ts +2 -0
@@ -17,6 +17,8 @@ export interface StackedPilledInputProps extends InputFieldProps {
17
17
  setError: UseFormSetError<FieldValues>;
18
18
  clearErrors: UseFormClearErrors<FieldValues>;
19
19
  control: Control<FieldValues, any>;
20
+ separators?: string[];
21
+ variant?: string;
20
22
  }
21
23
 
22
24
  /**
@@ -25,318 +27,336 @@ export interface StackedPilledInputProps extends InputFieldProps {
25
27
  const StackedPilledInput = React.forwardRef<
26
28
  HTMLInputElement,
27
29
  StackedPilledInputProps
28
- >(({ name, setValue, control, placeholder, disabled }, _ref) => {
29
- const watchedValue = useWatch({ control, name: name as string });
30
- const [lastestFormValueToArray, setLatestFormValueToArray] = useState<
31
- string[]
32
- >([]);
33
-
34
- const inputRef = useRef<HTMLInputElement>(null);
35
- const inputWrapperRef = useRef(null);
36
- const scrollRef = useRef<HTMLDivElement>(null);
37
-
38
- const [tokenIndex, setTokenIndex] = useState<number | null>(null);
39
- const [isFocussed, setIsFocussed] = useState(false);
40
- const [localValue, setLocalValue] = useState('');
41
-
42
- const latestTokenElement = document.getElementById(
43
- `${name}_token_${lastestFormValueToArray.length - 1}`
44
- );
45
-
46
- // gets latest watched form value (common delimited) from RHF state and creates a list
47
- useEffect(() => {
48
- if (watchedValue !== undefined && !watchedValue.length) {
49
- setLatestFormValueToArray([]);
50
- }
51
-
52
- if (watchedValue !== undefined && watchedValue?.length) {
53
- setLatestFormValueToArray(
54
- watchedValue
55
- .split(';')
56
- .join(',')
57
- .split(',')
58
- .filter(Boolean)
59
- );
30
+ >(
31
+ (
32
+ {
33
+ name,
34
+ setValue,
35
+ control,
36
+ placeholder,
37
+ disabled,
38
+ separators = ['Enter', ' ', ',', ';', 'Tab'],
39
+ variant,
40
+ },
41
+ _ref
42
+ ) => {
43
+ const watchedValue = useWatch({ control, name: name as string });
44
+ const [lastestFormValueToArray, setLatestFormValueToArray] = useState<
45
+ string[]
46
+ >([]);
47
+
48
+ const inputRef = useRef<HTMLInputElement>(null);
49
+ const inputWrapperRef = useRef(null);
50
+ const scrollRef = useRef<HTMLDivElement>(null);
51
+
52
+ const [tokenIndex, setTokenIndex] = useState<number | null>(null);
53
+ const [isFocussed, setIsFocussed] = useState(false);
54
+ const [localValue, setLocalValue] = useState('');
55
+
56
+ const latestTokenElement = document.getElementById(
57
+ `${name}_token_${lastestFormValueToArray.length - 1}`
58
+ );
60
59
 
61
- if (latestTokenElement) {
62
- latestTokenElement.scrollIntoView({
63
- block: 'end',
64
- inline: 'center',
65
- behavior: 'smooth',
66
- });
60
+ // gets latest watched form value (common delimited) from RHF state and creates a list
61
+ useEffect(() => {
62
+ if (watchedValue !== undefined && !watchedValue.length) {
63
+ setLatestFormValueToArray([]);
67
64
  }
68
- }
69
- }, [latestTokenElement, watchedValue]);
70
-
71
- const onHandleKeyDown = (e: React.KeyboardEvent) => {
72
- if (e.key === 'Enter') {
73
- e.stopPropagation();
74
- e.preventDefault();
75
- }
76
-
77
- if (
78
- (e.key === 'Enter' ||
79
- e.key === ',' ||
80
- e.key === ';' ||
81
- e.key === 'Tab') &&
82
- localValue.trim().length
83
- ) {
84
- if (
85
- e.key === 'Enter' &&
86
- !localValue.trim().length &&
87
- tokenIndex !== null
88
- ) {
89
- setLocalValue(lastestFormValueToArray[tokenIndex]);
90
65
 
91
- const filteredUniqueValues = Array.from(
92
- new Set(
93
- lastestFormValueToArray.filter(
94
- value => value !== lastestFormValueToArray[tokenIndex]
95
- )
96
- )
66
+ if (watchedValue !== undefined && watchedValue?.length) {
67
+ setLatestFormValueToArray(
68
+ watchedValue
69
+ .split(';')
70
+ .join(',')
71
+ .split(',')
72
+ .filter(Boolean)
97
73
  );
98
74
 
99
- setValue(name as string, filteredUniqueValues.toString(), {
100
- shouldValidate: true,
101
- shouldDirty: true,
102
- });
103
-
104
- return setTokenIndex(null);
75
+ if (latestTokenElement) {
76
+ latestTokenElement.scrollIntoView({
77
+ block: 'end',
78
+ inline: 'center',
79
+ behavior: 'smooth',
80
+ });
81
+ }
105
82
  }
83
+ }, [latestTokenElement, watchedValue]);
106
84
 
107
- const filteredUniqueValues = Array.from(
108
- new Set([
109
- ...lastestFormValueToArray,
110
- ...localValue
85
+ const handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {
86
+ if (tokenIndex === null) {
87
+ setLocalValue(
88
+ e.target.value
111
89
  .trim()
112
- .split(';')
113
- .join(',')
114
- .split(','),
115
- ])
116
- );
90
+ .replace(',', '')
91
+ .replace(';', '').length
92
+ ? e.target.value
93
+ : ''
94
+ );
95
+ }
96
+ };
117
97
 
118
- setLocalValue('');
98
+ const onHandleKeyDown = (e: React.KeyboardEvent) => {
99
+ if (e.key === 'Enter') {
100
+ e.stopPropagation();
101
+ e.preventDefault();
102
+ }
119
103
 
120
- return setValue(name as string, filteredUniqueValues.toString(), {
121
- shouldValidate: true,
122
- shouldDirty: true,
123
- });
124
- }
104
+ if (separators.includes(e.key)) {
105
+ if (
106
+ e.key === 'Enter' &&
107
+ !localValue.trim().length &&
108
+ tokenIndex !== null
109
+ ) {
110
+ setLocalValue(lastestFormValueToArray[tokenIndex]);
111
+
112
+ const filteredUniqueValues = Array.from(
113
+ new Set(
114
+ lastestFormValueToArray.filter(
115
+ value => value !== lastestFormValueToArray[tokenIndex]
116
+ )
117
+ )
118
+ );
125
119
 
126
- if (!localValue.trim().length && lastestFormValueToArray.length) {
127
- if (e.key === 'Backspace' && tokenIndex !== null) {
128
- setLocalValue(
129
- lastestFormValueToArray[tokenIndex].substring(
130
- 0,
131
- lastestFormValueToArray[tokenIndex].length
132
- )
133
- );
120
+ setValue(name as string, filteredUniqueValues.toString(), {
121
+ shouldValidate: true,
122
+ shouldDirty: true,
123
+ });
124
+
125
+ return setTokenIndex(null);
126
+ }
134
127
 
135
128
  const filteredUniqueValues = Array.from(
136
- new Set(
137
- [...lastestFormValueToArray].filter(
138
- value => value !== lastestFormValueToArray[tokenIndex]
139
- )
140
- )
129
+ new Set([
130
+ ...lastestFormValueToArray,
131
+ ...localValue
132
+ .trim()
133
+ .split(';')
134
+ .join(',')
135
+ .split(','),
136
+ ])
141
137
  );
142
138
 
143
- setValue(name as string, filteredUniqueValues.toString(), {
139
+ setLocalValue('');
140
+
141
+ return setValue(name as string, filteredUniqueValues.toString(), {
144
142
  shouldValidate: true,
145
143
  shouldDirty: true,
146
144
  });
147
-
148
- return setTokenIndex(null);
149
145
  }
150
146
 
151
- if (e.key === 'ArrowLeft') {
152
- if (tokenIndex === 0) return;
147
+ if (!localValue.trim().length && lastestFormValueToArray.length) {
148
+ if (e.key === 'Backspace' && tokenIndex !== null) {
149
+ setLocalValue(
150
+ lastestFormValueToArray[tokenIndex].substring(
151
+ 0,
152
+ lastestFormValueToArray[tokenIndex].length
153
+ )
154
+ );
153
155
 
154
- if (!tokenIndex) {
155
- return setTokenIndex(lastestFormValueToArray.length - 1);
156
+ const filteredUniqueValues = Array.from(
157
+ new Set(
158
+ [...lastestFormValueToArray].filter(
159
+ value => value !== lastestFormValueToArray[tokenIndex]
160
+ )
161
+ )
162
+ );
163
+
164
+ setValue(name as string, filteredUniqueValues.toString(), {
165
+ shouldValidate: true,
166
+ shouldDirty: true,
167
+ });
168
+
169
+ return setTokenIndex(null);
156
170
  }
157
171
 
158
- setTokenIndex(prevTokenIndex => (prevTokenIndex as number) - 1);
172
+ if (e.key === 'ArrowLeft') {
173
+ if (tokenIndex === 0) return;
159
174
 
160
- const tokenElement = document.getElementById(
161
- `${name}_token_${tokenIndex}`
162
- );
175
+ if (!tokenIndex) {
176
+ return setTokenIndex(lastestFormValueToArray.length - 1);
177
+ }
163
178
 
164
- if (!tokenElement || !scrollRef.current) return;
179
+ setTokenIndex(prevTokenIndex => (prevTokenIndex as number) - 1);
165
180
 
166
- return scrollRef.current.scrollBy({
167
- left: -1 * tokenElement.getBoundingClientRect().width,
168
- behavior: 'smooth',
169
- });
170
- }
181
+ const tokenElement = document.getElementById(
182
+ `${name}_token_${tokenIndex}`
183
+ );
171
184
 
172
- if (e.key === 'ArrowRight') {
173
- if (tokenIndex === null) return;
185
+ if (!tokenElement || !scrollRef.current) return;
174
186
 
175
- if (tokenIndex === lastestFormValueToArray.length - 1) {
176
- return setTokenIndex(null);
187
+ return scrollRef.current.scrollBy({
188
+ left: -1 * tokenElement.getBoundingClientRect().width,
189
+ behavior: 'smooth',
190
+ });
177
191
  }
178
- setTokenIndex(prevTokenIndex => (prevTokenIndex as number) + 1);
179
-
180
- const tokenElement = document.getElementById(
181
- `${name}_token_${tokenIndex}`
182
- );
183
192
 
184
- if (!tokenElement || !scrollRef.current) return;
193
+ if (e.key === 'ArrowRight') {
194
+ if (tokenIndex === null) return;
185
195
 
186
- return scrollRef.current.scrollBy({
187
- left: tokenElement.getBoundingClientRect().width,
188
- behavior: 'smooth',
189
- });
190
- }
191
- }
192
- };
196
+ if (tokenIndex === lastestFormValueToArray.length - 1) {
197
+ return setTokenIndex(null);
198
+ }
199
+ setTokenIndex(prevTokenIndex => (prevTokenIndex as number) + 1);
193
200
 
194
- const onRemoveTag = (index: number) => {
195
- const filteredUniqueValues = lastestFormValueToArray.filter(
196
- (_, i) => i !== index
197
- );
201
+ const tokenElement = document.getElementById(
202
+ `${name}_token_${tokenIndex}`
203
+ );
198
204
 
199
- setLatestFormValueToArray(filteredUniqueValues);
205
+ if (!tokenElement || !scrollRef.current) return;
200
206
 
201
- setValue(name as string, filteredUniqueValues.toString(), {
202
- shouldValidate: true,
203
- shouldDirty: true,
204
- });
205
- };
207
+ return scrollRef.current.scrollBy({
208
+ left: tokenElement.getBoundingClientRect().width,
209
+ behavior: 'smooth',
210
+ });
211
+ }
212
+ }
213
+ };
206
214
 
207
- const onBlur = () => {
208
- if (localValue.trim().length) {
209
- const filteredUniqueValues = Array.from(
210
- new Set([...lastestFormValueToArray, ...localValue.trim().split(',')])
215
+ const onRemoveTag = (index: number) => {
216
+ const filteredUniqueValues = lastestFormValueToArray.filter(
217
+ (_, i) => i !== index
211
218
  );
212
219
 
220
+ setLatestFormValueToArray(filteredUniqueValues);
221
+
213
222
  setValue(name as string, filteredUniqueValues.toString(), {
214
223
  shouldValidate: true,
215
224
  shouldDirty: true,
216
225
  });
217
- setLocalValue('');
218
- }
219
- setIsFocussed(false);
220
- };
221
-
222
- useOutsideClick({
223
- ref: inputWrapperRef,
224
- handler: () => {
225
- onBlur();
226
- },
227
- });
228
-
229
- return (
230
- <Box position="relative">
231
- <Flex
232
- fontSize="13px"
233
- border={isFocussed ? '2px solid' : '.5px solid'}
234
- borderColor={isFocussed ? colors.border.focus : colors.border.default}
235
- pl="8px"
236
- borderRadius="4px"
237
- alignItems="center"
238
- justifyContent="space-between"
239
- onClick={() => {
240
- if (isFocussed && tokenIndex !== null) {
241
- setTokenIndex(null);
242
- }
226
+ };
243
227
 
244
- if (!disabled) {
245
- inputRef.current?.focus();
246
- }
247
- }}
248
- bg={disabled ? colors.fill.light.quaternary : '#ffffff'}
249
- cursor={disabled ? 'not-allowed' : 'pointer'}
250
- ref={inputWrapperRef}
251
- h="26px"
252
- >
228
+ const onBlur = () => {
229
+ if (localValue.trim().length) {
230
+ const filteredUniqueValues = Array.from(
231
+ new Set([...lastestFormValueToArray, ...localValue.trim().split(',')])
232
+ );
233
+
234
+ setValue(name as string, filteredUniqueValues.toString(), {
235
+ shouldValidate: true,
236
+ shouldDirty: true,
237
+ });
238
+ setLocalValue('');
239
+ }
240
+ setIsFocussed(false);
241
+ };
242
+
243
+ useOutsideClick({
244
+ ref: inputWrapperRef,
245
+ handler: () => {
246
+ onBlur();
247
+ },
248
+ });
249
+ const isMobile = variant === 'mobile';
250
+
251
+ return (
252
+ <Box position="relative">
253
253
  <Flex
254
- h="100%"
254
+ fontSize={isMobile ? '17px' : '13px'}
255
+ border={isFocussed ? '2px solid' : '.5px solid'}
256
+ borderColor={isFocussed ? colors.border.focus : colors.border.default}
257
+ pl="8px"
258
+ borderRadius={isMobile ? '0' : '4px'}
255
259
  alignItems="center"
256
- overflowX="scroll"
257
- overflowY="hidden"
258
- maxWidth={isFocussed ? '80%' : '100%'}
259
- style={{
260
- scrollbarWidth: 'none' /* Firefox */,
261
- msOverflowStyle: 'none',
260
+ justifyContent="space-between"
261
+ onClick={() => {
262
+ if (isFocussed && tokenIndex !== null) {
263
+ setTokenIndex(null);
264
+ }
265
+
266
+ if (!disabled) {
267
+ inputRef.current?.focus();
268
+ }
262
269
  }}
263
- sx={{
264
- '::-webkit-scrollbar': {
265
- display: 'none',
266
- },
267
- }}
268
- ref={scrollRef}
269
- zIndex={100}
270
- onKeyDown={onHandleKeyDown}
270
+ bg={disabled ? colors.fill.light.quaternary : '#ffffff'}
271
+ cursor={disabled ? 'not-allowed' : 'pointer'}
272
+ ref={inputWrapperRef}
273
+ h={isMobile ? '48px' : '26px'}
271
274
  >
272
- {lastestFormValueToArray.length
273
- ? lastestFormValueToArray.map((label, index) => (
274
- <Box
275
- key={index}
276
- mr="4px"
277
- border={
278
- tokenIndex === index
279
- ? `1px solid ${colors.border.focus}`
280
- : 'none'
281
- }
282
- borderRadius="full"
283
- onClick={() => setTokenIndex(index)}
284
- width="100%"
285
- id={`${name}_token_${index}`}
286
- >
287
- <Token
288
- label={label}
289
- onDelete={(e: any) => {
290
- e.stopPropagation();
291
- e.preventDefault();
292
- onRemoveTag(index);
293
- }}
294
- />
295
- </Box>
296
- ))
297
- : null}
298
- {!lastestFormValueToArray.length && !isFocussed ? (
299
- <Text color={colors.label.secondary.light} fontSize="13px">
300
- {placeholder}
301
- </Text>
302
- ) : null}
303
- </Flex>
304
- {!disabled && (
305
- <Flex flex={1} minWidth={isFocussed && !tokenIndex ? '20%' : 0}>
306
- <Input
307
- onKeyDown={onHandleKeyDown}
308
- type="text"
309
- padding={0}
310
- alignContent="flex-start"
311
- float="right"
312
- border="none"
313
- height="auto"
314
- color={tokenIndex !== null ? 'transparent' : colors.label.primary}
315
- _focus={{ boxShadow: 'none !important' }}
316
- value={localValue}
317
- onChange={e =>
318
- tokenIndex === null &&
319
- setLocalValue(
320
- e.target.value
321
- .trim()
322
- .replace(',', '')
323
- .replace(';', '').length
324
- ? e.target.value
325
- : ''
326
- )
327
- }
328
- ref={inputRef}
329
- onFocus={() => setIsFocussed(true)}
330
- onBlur={() => {
331
- setIsFocussed(false);
332
- return setTokenIndex(null);
333
- }}
334
- />
275
+ <Flex
276
+ h="100%"
277
+ alignItems="center"
278
+ overflowX="scroll"
279
+ overflowY="hidden"
280
+ maxWidth={isFocussed ? '80%' : '100%'}
281
+ style={{
282
+ scrollbarWidth: 'none' /* Firefox */,
283
+ msOverflowStyle: 'none',
284
+ }}
285
+ sx={{
286
+ '::-webkit-scrollbar': {
287
+ display: 'none',
288
+ },
289
+ }}
290
+ ref={scrollRef}
291
+ zIndex={100}
292
+ onKeyDown={onHandleKeyDown}
293
+ >
294
+ {lastestFormValueToArray.length
295
+ ? lastestFormValueToArray.map((label, index) => (
296
+ <Box
297
+ key={index}
298
+ mr="4px"
299
+ border={
300
+ tokenIndex === index
301
+ ? `1px solid ${colors.border.focus}`
302
+ : 'none'
303
+ }
304
+ borderRadius="full"
305
+ onClick={() => setTokenIndex(index)}
306
+ width="100%"
307
+ id={`${name}_token_${index}`}
308
+ >
309
+ <Token
310
+ label={label}
311
+ onDelete={(e: any) => {
312
+ e.stopPropagation();
313
+ e.preventDefault();
314
+ onRemoveTag(index);
315
+ }}
316
+ isMobile={isMobile}
317
+ />
318
+ </Box>
319
+ ))
320
+ : null}
321
+ {!lastestFormValueToArray.length && !isFocussed ? (
322
+ <Text
323
+ color={colors.label.secondary.light}
324
+ fontSize={isMobile ? '17px' : '13px'}
325
+ >
326
+ {placeholder}
327
+ </Text>
328
+ ) : null}
335
329
  </Flex>
336
- )}
337
- </Flex>
338
- </Box>
339
- );
340
- });
330
+ {!disabled && (
331
+ <Flex flex={1} minWidth={isFocussed && !tokenIndex ? '20%' : 0}>
332
+ <Input
333
+ onKeyDown={onHandleKeyDown}
334
+ type="text"
335
+ padding={0}
336
+ alignContent="flex-start"
337
+ float="right"
338
+ border="none"
339
+ height="auto"
340
+ color={
341
+ tokenIndex !== null ? 'transparent' : colors.label.primary
342
+ }
343
+ _focus={{ boxShadow: 'none !important' }}
344
+ value={localValue}
345
+ onChange={handleOnChange}
346
+ ref={inputRef}
347
+ onFocus={() => setIsFocussed(true)}
348
+ onBlur={() => {
349
+ setIsFocussed(false);
350
+ return setTokenIndex(null);
351
+ }}
352
+ variant={variant}
353
+ />
354
+ </Flex>
355
+ )}
356
+ </Flex>
357
+ </Box>
358
+ );
359
+ }
360
+ );
341
361
 
342
362
  export default StackedPilledInput;
@@ -1,8 +1,12 @@
1
1
  import React from 'react';
2
- import { Textarea } from '@chakra-ui/react';
2
+ import { Flex, Textarea } from '@chakra-ui/react';
3
3
  import { TextareaFieldProps } from '../InputTypes';
4
4
 
5
- export interface StackedTextareaProps extends TextareaFieldProps {}
5
+ export interface StackedTextareaProps extends TextareaFieldProps {
6
+ isRequired?: boolean;
7
+ allowDefault?: boolean;
8
+ variant: string;
9
+ }
6
10
 
7
11
  /**
8
12
  * A functional React component utilized to render the `StackedTextarea` component.
@@ -10,14 +14,34 @@ export interface StackedTextareaProps extends TextareaFieldProps {}
10
14
  const StackedTextarea = React.forwardRef<
11
15
  HTMLTextAreaElement,
12
16
  StackedTextareaProps
13
- >(({ ...props }, _ref) => {
17
+ >(({ isRequired, allowDefault, variant, ...props }, _ref) => {
18
+ if (variant === 'mobile') {
19
+ return (
20
+ <Flex>
21
+ {allowDefault}
22
+ <Textarea
23
+ ref={_ref}
24
+ {...props}
25
+ variant={variant}
26
+ fontSize="17px"
27
+ onKeyDown={e => {
28
+ if (e.key === 'Enter' && !allowDefault) {
29
+ e.stopPropagation();
30
+ e.preventDefault();
31
+ }
32
+ }}
33
+ />
34
+ </Flex>
35
+ );
36
+ }
14
37
  return (
15
38
  <Textarea
16
39
  ref={_ref}
17
40
  {...props}
18
- fontSize="13px"
41
+ variant={variant}
42
+ fontSize={variant === '' ? '13px' : '17px'}
19
43
  onKeyDown={e => {
20
- if (e.key === 'Enter') {
44
+ if (e.key === 'Enter' && !allowDefault) {
21
45
  e.stopPropagation();
22
46
  e.preventDefault();
23
47
  }
@@ -23,7 +23,7 @@ export const Dropdown: React.FC<DropdownProps> = ({
23
23
  }) => {
24
24
  const DropdownContent = useMemo(() => {
25
25
  return options.map((option, idx) => (
26
- <Box key={idx} width="100%">
26
+ <Box key={idx} width="100%" role="combobox">
27
27
  {option.value === 'section_header' &&
28
28
  options[idx + 1] &&
29
29
  options[idx + 1].value !== 'section_header' && (