@xqmsg/ui-core 0.24.5 → 0.24.6

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.24.5",
2
+ "version": "0.24.6",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -20,6 +20,7 @@ export interface StackedPilledInputProps extends InputFieldProps {
20
20
  separators?: string[];
21
21
  variant?: string;
22
22
  label?: string;
23
+ truncatePillLength?: number;
23
24
  }
24
25
 
25
26
  /**
@@ -39,6 +40,7 @@ const StackedPilledInput = React.forwardRef<
39
40
  separators = ['Enter', ' ', ',', ';', 'Tab'],
40
41
  variant,
41
42
  label,
43
+ truncatePillLength,
42
44
  },
43
45
  _ref
44
46
  ) => {
@@ -332,6 +334,7 @@ const StackedPilledInput = React.forwardRef<
332
334
  onRemoveTag(index);
333
335
  }}
334
336
  isMobile={isMobile}
337
+ truncateLength={truncatePillLength}
335
338
  />
336
339
  </Box>
337
340
  ))
@@ -8,10 +8,16 @@ export interface TokenProps {
8
8
  label: any;
9
9
  onDelete: any;
10
10
  isMobile?: boolean;
11
+ truncateLength?: number;
11
12
  }
12
13
 
13
14
  // For v1 we are truncating the label at 15 characters to avoid overflow
14
- const Token: React.FC<TokenProps> = ({ label, onDelete, isMobile = false }) => {
15
+ const Token: React.FC<TokenProps> = ({
16
+ label,
17
+ onDelete,
18
+ isMobile = false,
19
+ truncateLength = 15,
20
+ }) => {
15
21
  return (
16
22
  <Flex
17
23
  key={label}
@@ -33,7 +39,7 @@ const Token: React.FC<TokenProps> = ({ label, onDelete, isMobile = false }) => {
33
39
  pr="4px"
34
40
  >
35
41
  {truncate(label.trim(), {
36
- length: 15,
42
+ length: truncateLength,
37
43
  omission: '...',
38
44
  })}
39
45
  </Text>
@@ -51,6 +51,7 @@ export interface InputProps<T extends FieldValues = FieldValues>
51
51
  variant?: string;
52
52
  separators?: string[];
53
53
  loadingOptions?: boolean;
54
+ truncatePillLength?: number;
54
55
  }
55
56
 
56
57
  /**
@@ -84,6 +85,7 @@ export function Input<T extends FieldValues>({
84
85
  clearErrors,
85
86
  separators,
86
87
  loadingOptions = false,
88
+ truncatePillLength,
87
89
  }: InputProps<T>) {
88
90
  function selectedInputField<T extends Element = Element>(
89
91
  onChange: ((e: ChangeEvent<T>) => void) | ((v?: string) => void),
@@ -232,6 +234,7 @@ export function Input<T extends FieldValues>({
232
234
  variant={variant}
233
235
  label={label}
234
236
  separators={separators}
237
+ truncatePillLength={truncatePillLength}
235
238
  />
236
239
  );
237
240
  case 'switch':