@thecb/components 6.0.0-beta.8 → 6.0.0-beta.9

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.8",
3
+ "version": "6.0.0-beta.9",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -122,7 +122,8 @@ const Dropdown = ({
122
122
  value ? options.find(option => option.value === value)?.text : placeholder;
123
123
 
124
124
  const onKeyDown = e => {
125
- console.log("key down event is", e);
125
+ console.log("key down event is", e.target);
126
+ console.log("key down event value is", e.target.value);
126
127
  const { key, keyCode } = e;
127
128
  const focus = document.activeElement;
128
129
  console.log("dropdown value is", value);
@@ -238,9 +239,10 @@ const Dropdown = ({
238
239
  <Box
239
240
  onKeyDown={onKeyDown}
240
241
  onClick={onClick}
241
- padding="0"
242
+ padding="12px"
242
243
  width="100%"
243
244
  hoverStyles={`background-color: ${themeValues.hoverColor};`}
245
+ background={isOpen ? themeValues.hoverColor : WHITE}
244
246
  aria-expanded={isOpen}
245
247
  role="combobox"
246
248
  aria-owns={`${ariaLabelledby}_listbox`}
@@ -253,60 +255,43 @@ const Dropdown = ({
253
255
  pointer-events: none;`
254
256
  }
255
257
  title={hasTitles ? getSelection() : null}
258
+ dataQa={placeholder}
259
+ tabIndex={0}
260
+ borderRadius="2px"
261
+ borderSize="1px"
262
+ borderColor={
263
+ isError
264
+ ? ERROR_COLOR
265
+ : isOpen
266
+ ? themeValues.selectedColor
267
+ : GREY_CHATEAU
268
+ }
256
269
  >
257
- <Box
258
- as="button"
259
- background={isOpen ? themeValues.hoverColor : WHITE}
260
- width="100%"
261
- padding="12px"
262
- hoverStyles={`background-color: ${themeValues.hoverColor};`}
263
- borderSize="1px"
264
- borderColor={
265
- isError
266
- ? ERROR_COLOR
267
- : isOpen
268
- ? themeValues.selectedColor
269
- : GREY_CHATEAU
270
- }
271
- borderRadius="2px"
272
- tabIndex={0}
273
- dataQa={placeholder}
274
- extraStyles={`height: 48px;
275
- ${disabled &&
276
- `color: #6e727e;
277
- background-color: #f7f7f7;
278
- pointer-events: none;`}
279
- `}
280
- >
281
- <Stack
282
- direction="row"
283
- bottomItem={2}
284
- extraStyles={`position: relative;`}
285
- >
286
- <SearchInput
287
- aria-label={getSelection()}
288
- placeholder={getSelection()}
289
- value={inputValue}
290
- onChange={e => {
291
- console.log("input change event", e);
292
- }}
293
- themeValues={themeValues}
294
- role="searchbox"
295
- type="text"
296
- aria-multiline="false"
297
- aria-autocomplete="list"
298
- aria-controls={`${ariaLabelledby}_listbox`}
299
- aria-activedescendant="selected_option"
300
- isOpen={isOpen}
301
- tabIndex={-1}
302
- name={autocompleteValue}
303
- autocomplete={autocompleteValue}
304
- />
305
- <IconWrapper open={isOpen}>
306
- <DropdownIcon />
307
- </IconWrapper>
308
- </Stack>
309
- </Box>
270
+ <Stack direction="row" bottomItem={2} extraStyles={`position: relative;`}>
271
+ <SearchInput
272
+ aria-label={getSelection()}
273
+ placeholder={getSelection()}
274
+ value={inputValue}
275
+ onChange={e => {
276
+ console.log("input change event", e.target);
277
+ console.log("input change event value", e.target.value);
278
+ }}
279
+ themeValues={themeValues}
280
+ role="searchbox"
281
+ type="text"
282
+ aria-multiline="false"
283
+ aria-autocomplete="list"
284
+ aria-controls={`${ariaLabelledby}_listbox`}
285
+ aria-activedescendant="selected_option"
286
+ isOpen={isOpen}
287
+ tabIndex={-1}
288
+ name={autocompleteValue}
289
+ autocomplete={autocompleteValue}
290
+ />
291
+ <IconWrapper open={isOpen}>
292
+ <DropdownIcon />
293
+ </IconWrapper>
294
+ </Stack>
310
295
  {isOpen ? (
311
296
  <DropdownContentWrapper
312
297
  maxHeight={maxHeight}