@thecb/components 8.0.3-beta.3 → 8.0.3

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.3",
3
+ "version": "8.0.3",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -34,10 +34,6 @@ const Card = ({
34
34
  width = "276px",
35
35
  children
36
36
  }) => {
37
- console.log(
38
- "themeValues.imageBackgroundColor",
39
- themeValues.imageBackgroundColor
40
- );
41
37
  const hasImage = Image || imgSrc;
42
38
  const numberOfChildren =
43
39
  (Array.isArray(children) ? children.length : 1) +
@@ -70,7 +66,11 @@ const Card = ({
70
66
  )}
71
67
  <Stack direction="row" childGap="0">
72
68
  {Image && !imgSrc && (
73
- <Box minHeight={imgHeight} padding="0" background="#E4F4FD">
69
+ <Box
70
+ minHeight={imgHeight}
71
+ padding="0"
72
+ background={themeValues.imageBackgroundColor}
73
+ >
74
74
  <Cover minHeight={imgHeight} singleChild>
75
75
  <Center intrinsic>
76
76
  <Image alt={imgAltText} />
@@ -2,8 +2,9 @@ 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
+ import { fallbackValues } from "./RadioButtonWithLabel.theme";
7
8
 
8
9
  const HiddenRadioInput = styled.input`
9
10
  // 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 +19,7 @@ const Circle = styled.div`
18
19
  margin-right: 8px;
19
20
  width: 1.5rem;
20
21
  height 1.5rem;
21
- border: 1px solid ${colors.GREY_CHATEAU};
22
+ border: ${({ inactiveBorderColor }) => `1px solid ${inactiveBorderColor}`};
22
23
  border-radius: 50%;
23
24
  box-sizing: border-box;
24
25
  padding: 2px;
@@ -27,7 +28,7 @@ const Circle = styled.div`
27
28
  width: 100%;
28
29
  height: 100%;
29
30
  display: block;
30
- background: ${colors.MATISSE_BLUE};
31
+ background: ${({ activeColor }) => activeColor};
31
32
  border-radius: 50%;
32
33
  transform: scale(0);
33
34
  }
@@ -40,10 +41,10 @@ const InputAndLabelContainer = styled(Cluster)`
40
41
  transition: transform 0.15s;
41
42
  }
42
43
  ${HiddenRadioInput}:checked + label ${Circle} {
43
- border: 1px solid ${colors.MATISSE_BLUE};
44
+ border: ${({ activeColor }) => `1px solid ${activeColor};`}
44
45
  }
45
46
  ${HiddenRadioInput}:focus + label ${Circle} { {
46
- box-shadow: 0px 0px 2px 1px ${colors.MATISSE_BLUE};
47
+ box-shadow: ${({ activeColor }) => `0px 0px 2px 1px ${activeColor};`}
47
48
  }
48
49
  `;
49
50
 
@@ -54,10 +55,15 @@ const RadioButtonWithLabel = ({
54
55
  groupName,
55
56
  setValue,
56
57
  ariaInvalid,
58
+ themeValues,
57
59
  index,
58
60
  handleChange = noop // optional, for custom event handling in ingesting app
59
61
  }) => (
60
- <InputAndLabelContainer align="center" childGap="0.5rem">
62
+ <InputAndLabelContainer
63
+ align="center"
64
+ childGap="0.5rem"
65
+ activeColor={themeValues.activeColor}
66
+ >
61
67
  <HiddenRadioInput
62
68
  aria-invalid={ariaInvalid}
63
69
  style={{ marginTop: 0 }}
@@ -83,10 +89,17 @@ const RadioButtonWithLabel = ({
83
89
  }
84
90
  `}
85
91
  >
86
- <Circle />
92
+ <Circle
93
+ activeColor={themeValues.activeColor}
94
+ inactiveBorderColor={themeValues.inactiveBorderColor}
95
+ />
87
96
  {labelText}
88
97
  </Text>
89
98
  </InputAndLabelContainer>
90
99
  );
91
100
 
92
- export default RadioButtonWithLabel;
101
+ export default themeComponent(
102
+ RadioButtonWithLabel,
103
+ "RadioButtonWithLabel",
104
+ fallbackValues
105
+ );
@@ -0,0 +1,8 @@
1
+ import { GREY_CHATEAU, MATISSE_BLUE } from "../../../constants/colors";
2
+ const activeColor = MATISSE_BLUE;
3
+ const inactiveBorderColor = GREY_CHATEAU;
4
+
5
+ export const fallbackValues = {
6
+ inactiveBorderColor,
7
+ activeColor
8
+ };
@@ -39,7 +39,7 @@ const AutopayModal = ({
39
39
  ? "checking account payment method"
40
40
  : "payment method";
41
41
 
42
- return `To setup ${planText} you must have a saved ${methodRequired} and address in your profile. Do you want to save these now?`;
42
+ return `To setup ${planText} you must have a saved ${methodRequired} and address. Do you want to save these now?`;
43
43
  };
44
44
  const plan = isPaymentPlan ? "your payment plan" : "autopay";
45
45
  const shortPlan = isPaymentPlan ? "Payment Plan" : "Autopay";
@@ -57,9 +57,7 @@ const AutopayModal = ({
57
57
  : ""
58
58
  }`
59
59
  : generateMethodNeededText(plan, allowedPaymentInstruments),
60
- continueButtonText: autoPayActive
61
- ? `Disable ${shortPlan}`
62
- : "Add to Profile",
60
+ continueButtonText: autoPayActive ? `Disable ${shortPlan}` : "Add",
63
61
  useDangerButton: autoPayActive,
64
62
  continueAction: autoPayActive
65
63
  ? () => {
@@ -35,7 +35,7 @@ const RemoveAccountModalModule = ({
35
35
  hideModal={() => setModalIsOpen(false)}
36
36
  modalOpen={modalIsOpen}
37
37
  modalHeaderText={`Remove ${accountType}`}
38
- modalBodyText={`Are you sure you want to remove the ${identifier} ${accounts} from your profile? Any autopay scheduled against ${
38
+ modalBodyText={`Are you sure you want to remove the ${identifier} ${accounts}? Any autopay scheduled against ${
39
39
  obligations.length > 1 ? "them" : "it"
40
40
  } will be deactivated.`}
41
41
  continueButtonText="Remove"