@thecb/components 9.1.5-beta.0 → 9.1.7-beta.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "9.1.5-beta.0",
3
+ "version": "9.1.7-beta.0",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -12,11 +12,11 @@ import styled from "styled-components";
12
12
  import "core-js/proposals/relative-indexing-method";
13
13
 
14
14
  import {
15
- WHITE,
15
+ ERROR_COLOR,
16
16
  GREY_CHATEAU,
17
- STORM_GREY,
18
17
  MINESHAFT_GREY,
19
- ERROR_COLOR
18
+ STORM_GREY,
19
+ WHITE
20
20
  } from "../../../constants/colors";
21
21
  import { fallbackValues } from "./Dropdown.theme";
22
22
  import { themeComponent } from "../../../util/themeUtils";
@@ -55,10 +55,8 @@ const DropdownContentWrapper = styled.div`
55
55
  `;
56
56
 
57
57
  const DropdownItemWrapper = styled.li`
58
- background-color: ${({ selected, themeValues }) =>
59
- selected ? themeValues.selectedColor : WHITE};
60
58
  text-align: start;
61
- border-width: 0px;
59
+ border-width: 2px;
62
60
  border-color: transparent;
63
61
  box-shadow: none;
64
62
  padding: 1rem;
@@ -67,6 +65,23 @@ const DropdownItemWrapper = styled.li`
67
65
  list-style: none;
68
66
  cursor: ${({ disabled }) => (disabled ? "default" : "pointer")};
69
67
 
68
+ &:hover {
69
+ border-color: themeValues.selectedColor;
70
+ }
71
+ &:focus {
72
+ outline: none;
73
+ border-color: themeValues.selectedColor;
74
+ }
75
+ `;
76
+ // ${({ selected, themeValues }) =>
77
+ // selected ? themeValues.selectedColor : TRANSPARENT};
78
+ const DropdownItemBorder = styled.div`
79
+ background-color: ${({ selected, themeValues }) =>
80
+ selected ? themeValues.selectedColor : WHITE};
81
+ border-width: 2px;
82
+ border-color: white;
83
+ width: 100%;
84
+
70
85
  &:hover {
71
86
  background-color: ${({ selected, disabled, themeValues }) =>
72
87
  selected
@@ -385,27 +400,29 @@ const Dropdown = ({
385
400
  role="option"
386
401
  onFocus={() => setFocusedRef(optionRefs.current[i])}
387
402
  >
388
- <Text
389
- variant="p"
390
- color={
391
- choice.value === value
392
- ? WHITE
393
- : disabledValues.includes(choice.value)
394
- ? STORM_GREY
395
- : MINESHAFT_GREY
396
- }
397
- extraStyles={`padding-left: 16px;
398
- cursor: ${
399
- disabledValues.includes(choice.value)
400
- ? "default"
401
- : "pointer"
402
- };
403
- white-space: nowrap;
404
- overflow: hidden;
405
- text-overflow: ellipsis;`}
406
- >
407
- {choice.text}
408
- </Text>
403
+ <DropdownItemBorder selected={choice.value === value}>
404
+ <Text
405
+ variant="p"
406
+ color={
407
+ choice.value === value
408
+ ? WHITE
409
+ : disabledValues.includes(choice.value)
410
+ ? STORM_GREY
411
+ : MINESHAFT_GREY
412
+ }
413
+ extraStyles={`padding-left: 16px;
414
+ cursor: ${
415
+ disabledValues.includes(choice.value)
416
+ ? "default"
417
+ : "pointer"
418
+ };
419
+ white-space: nowrap;
420
+ overflow: hidden;
421
+ text-overflow: ellipsis;`}
422
+ >
423
+ {choice.text}
424
+ </Text>
425
+ </DropdownItemBorder>
409
426
  </DropdownItemWrapper>
410
427
  );
411
428
  })}
@@ -25,7 +25,7 @@ const LineItem = ({
25
25
 
26
26
  const visibleCustomAttrs = customAttributes
27
27
  ?.filter(
28
- attr => visibleFields.includes(attr.key) && attr.key !== "description"
28
+ attr => visibleFields?.includes(attr.key) && attr.key !== "description"
29
29
  )
30
30
  ?.map(attr => (
31
31
  <Paragraph variant="pS" weight="400" key={attr.key} color={STORM_GREY}>