@thecb/components 8.0.3-beta.4 → 8.0.4-beta.2

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": "8.0.3-beta.4",
3
+ "version": "8.0.4-beta.2",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -70,7 +70,6 @@ const Card = ({
70
70
  minHeight={imgHeight}
71
71
  padding="0"
72
72
  background={themeValues.imageBackgroundColor}
73
- extraStyles={`background-color: ${themeValues.imageBackgroundColor}`}
74
73
  >
75
74
  <Cover minHeight={imgHeight} singleChild>
76
75
  <Center intrinsic>
@@ -2,8 +2,8 @@ import React from "react";
2
2
  import { Cluster } from "../../atoms/layouts";
3
3
  import Text from "../text";
4
4
  import styled from "styled-components";
5
- import { colors } from "../../../constants";
6
5
  import { noop } from "../../../util/general";
6
+ import { themeComponent } from "../../../util/themeUtils";
7
7
 
8
8
  const HiddenRadioInput = styled.input`
9
9
  // can still select the element with the keyboard, but it's invisible and doesn't interfere with the spacing of other elements around it
@@ -18,7 +18,7 @@ const Circle = styled.div`
18
18
  margin-right: 8px;
19
19
  width: 1.5rem;
20
20
  height 1.5rem;
21
- border: 1px solid ${colors.GREY_CHATEAU};
21
+ border: ${({ borderColor }) => `1px solid ${borderColor}`};
22
22
  border-radius: 50%;
23
23
  box-sizing: border-box;
24
24
  padding: 2px;
@@ -27,7 +27,7 @@ const Circle = styled.div`
27
27
  width: 100%;
28
28
  height: 100%;
29
29
  display: block;
30
- background: ${colors.MATISSE_BLUE};
30
+ background: ${({ backgroundColor }) => backgroundColor};
31
31
  border-radius: 50%;
32
32
  transform: scale(0);
33
33
  }
@@ -40,10 +40,11 @@ const InputAndLabelContainer = styled(Cluster)`
40
40
  transition: transform 0.15s;
41
41
  }
42
42
  ${HiddenRadioInput}:checked + label ${Circle} {
43
- border: 1px solid ${colors.MATISSE_BLUE};
43
+ border: ${({ backgroundColor }) => `1px solid ${backgroundColor};`}
44
44
  }
45
45
  ${HiddenRadioInput}:focus + label ${Circle} { {
46
- box-shadow: 0px 0px 2px 1px ${colors.MATISSE_BLUE};
46
+ box-shadow: ${({ backgroundColor }) =>
47
+ `0px 0px 2px 1px ${backgroundColor};`}
47
48
  }
48
49
  `;
49
50
 
@@ -89,4 +90,8 @@ const RadioButtonWithLabel = ({
89
90
  </InputAndLabelContainer>
90
91
  );
91
92
 
92
- export default RadioButtonWithLabel;
93
+ export default themeComponent(
94
+ RadioButtonWithLabel,
95
+ "RadioButtonWithLabel",
96
+ fallbackValues
97
+ );
@@ -0,0 +1,8 @@
1
+ import { GREY_CHATEAU, MATISSE_BLUE } from "../../../constants/colors";
2
+ const backgroundColor = MATISSE_BLUE;
3
+ const borderColor = GREY_CHATEAU;
4
+
5
+ export const fallbackValues = {
6
+ borderColor,
7
+ backgroundColor
8
+ };