@thecb/components 9.2.2-beta.2 → 9.2.2-beta.4

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "9.2.2-beta.2",
3
+ "version": "9.2.2-beta.4",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -262,11 +262,13 @@ const Dropdown = ({
262
262
  useEffect(() => {
263
263
  if (autoEraseTypeAhead) {
264
264
  clearTimeout(timer);
265
- setTimer(setTimeout(() => setInputValue(""), 7000));
265
+ setTimer(setTimeout(() => setInputValue(""), 20000));
266
266
  }
267
267
  setFilteredOptions(
268
- options.filter(option =>
269
- option.value.toLowerCase().match(inputValue.toLowerCase())
268
+ options.filter(
269
+ option =>
270
+ option.value.toLowerCase().match(inputValue.toLowerCase()) ||
271
+ option.text.toLowerCase().match(inputValue.toLowerCase())
270
272
  )
271
273
  );
272
274
  }, [inputValue]);
@@ -96,26 +96,28 @@ const FormSelect = ({
96
96
  smoothScroll={smoothScroll}
97
97
  />
98
98
  <Stack direction="row" justify="space-between">
99
- <Text
100
- color={ERROR_COLOR}
101
- variant="pXS"
102
- weight={themeValues.fontWeight}
103
- extraStyles={`
99
+ {(field.hasErrors && field.dirty) || (field.hasErrors && showErrors) ? (
100
+ <Text
101
+ color={ERROR_COLOR}
102
+ variant="pXS"
103
+ weight={themeValues.fontWeight}
104
+ extraStyles={`
104
105
  word-break: break-word;
105
106
  font-family: Public Sans;
106
107
  &::first-letter {
107
108
  text-transform: uppercase;
108
109
  }
109
110
  `}
110
- id={createIdFromString(labelTextWhenNoError, "error message")}
111
- aria-live="polite"
112
- aria-atomic={true}
113
- data-qa={createIdFromString(labelTextWhenNoError, "error message")}
114
- >
115
- {(field.hasErrors && field.dirty) || (field.hasErrors && showErrors)
116
- ? errorMessages[field.errors[0]]
117
- : ""}
118
- </Text>
111
+ id={createIdFromString(labelTextWhenNoError, "error message")}
112
+ aria-live="polite"
113
+ aria-atomic={true}
114
+ data-qa={createIdFromString(labelTextWhenNoError, "error message")}
115
+ >
116
+ {errorMessages[field.errors[0]]}
117
+ </Text>
118
+ ) : (
119
+ <Text extraStyles={`height: ${themeValues.lineHeight};`} />
120
+ )}
119
121
  </Stack>
120
122
  </SelectContainer>
121
123
  );