@thecb/components 6.0.0-beta.5 → 6.0.0-beta.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "6.0.0-beta.5",
3
+ "version": "6.0.0-beta.6",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -74,11 +74,10 @@ const DropdownItemWrapper = styled.div`
74
74
 
75
75
  const SearchInput = styled.input`
76
76
  border: none;
77
- background-color: ${({ themeValues, isOpen }) =>
78
- isOpen ? themeValues.hoverColor && themeValues.hoverColor : "WHITE"};
77
+ background-color: transparent;
79
78
  font-size: 16px;
80
79
  height: 24px;
81
- min-width: 75%;
80
+ min-width: 80%;
82
81
  `;
83
82
 
84
83
  const Dropdown = ({
@@ -96,7 +95,8 @@ const Dropdown = ({
96
95
  disabled,
97
96
  hasTitles = false,
98
97
  autoEraseTypeAhead = true, // legacy behavior as of 05/22
99
- ariaLabelledby
98
+ ariaLabelledby,
99
+ autocompleteValue = "" // autofill item for browsers, like country-name or address-level1 for state
100
100
  }) => {
101
101
  const [inputValue, setInputValue] = useState("");
102
102
  const [optionsState, setOptionsState] = useState([]);
@@ -221,6 +221,8 @@ const Dropdown = ({
221
221
  !disabledValues.includes(filteredOptions[0].value) &&
222
222
  filteredOptions[0].text != placeholder
223
223
  ) {
224
+ console.log("filtered options are", filteredOptions);
225
+ console.log("option refs are", optionRefs);
224
226
  onSelect(filteredOptions[0].value);
225
227
  }
226
228
  if (optionRefs.current[0].current) {
@@ -274,7 +276,11 @@ const Dropdown = ({
274
276
  pointer-events: none;`}
275
277
  `}
276
278
  >
277
- <Stack direction="row" bottomItem={2}>
279
+ <Stack
280
+ direction="row"
281
+ bottomItem={2}
282
+ extraStyles={`position: relative;`}
283
+ >
278
284
  <SearchInput
279
285
  aria-label={getSelection()}
280
286
  placeholder={getSelection()}
@@ -288,6 +294,9 @@ const Dropdown = ({
288
294
  aria-controls={`${ariaLabelledby}_listbox`}
289
295
  aria-activedescendant="selected_option"
290
296
  isOpen={isOpen}
297
+ tabIndex={-1}
298
+ name={autocompleteValue}
299
+ autocomplete={autocompleteValue}
291
300
  />
292
301
  <IconWrapper open={isOpen}>
293
302
  <DropdownIcon />