@thecb/components 11.11.1-beta.2 → 11.11.1
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/dist/index.cjs.js +11 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +11 -17
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/card-type/CardType.js +1 -5
- package/src/components/atoms/formatted-bank-account/FormattedBankAccount.js +11 -5
- package/src/components/atoms/formatted-credit-card/FormattedCreditCard.js +30 -30
- package/src/components/molecules/editable-list/EditableList.js +9 -22
- package/src/components/molecules/radio-section/radio-button/RadioButton.js +1 -1
package/package.json
CHANGED
|
@@ -45,11 +45,7 @@ const CardType = ({ type, size = "small" }) => {
|
|
|
45
45
|
const normalizedType = normalizeType(type);
|
|
46
46
|
const { label, [size]: IconComponent } =
|
|
47
47
|
cardBrands[normalizedType] || cardBrands.default;
|
|
48
|
-
return
|
|
49
|
-
<span>
|
|
50
|
-
<IconComponent />
|
|
51
|
-
</span>
|
|
52
|
-
);
|
|
48
|
+
return <IconComponent />;
|
|
53
49
|
};
|
|
54
50
|
|
|
55
51
|
export default CardType;
|
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { themeComponent } from "../../../util/themeUtils";
|
|
4
4
|
import { fallbackValues } from "./FormattedBankAccount.theme";
|
|
5
|
-
import
|
|
6
|
-
import { Stack
|
|
5
|
+
import BankIconLarge from "../icons/BankIconLarge";
|
|
6
|
+
import { Stack } from "../layouts";
|
|
7
7
|
import Text from "../text";
|
|
8
8
|
|
|
9
9
|
export const BankItemWrapper = styled.div`
|
|
@@ -11,6 +11,12 @@ export const BankItemWrapper = styled.div`
|
|
|
11
11
|
justify-content: flex-start;
|
|
12
12
|
align-items: center;
|
|
13
13
|
`;
|
|
14
|
+
export const BankIconWrapper = styled.div`
|
|
15
|
+
margin-right: 8px;
|
|
16
|
+
width: 36px;
|
|
17
|
+
height: auto;
|
|
18
|
+
display: flex;
|
|
19
|
+
`;
|
|
14
20
|
|
|
15
21
|
export const BankAccountText = styled.h4`
|
|
16
22
|
color: ${({ color }) => color};
|
|
@@ -32,9 +38,9 @@ const FormattedBankAccount = ({
|
|
|
32
38
|
themeValues
|
|
33
39
|
}) => (
|
|
34
40
|
<BankItemWrapper>
|
|
35
|
-
<
|
|
36
|
-
<
|
|
37
|
-
</
|
|
41
|
+
<BankIconWrapper>
|
|
42
|
+
<BankIconLarge />
|
|
43
|
+
</BankIconWrapper>
|
|
38
44
|
<Stack childGap="0">
|
|
39
45
|
{accountType === CHECKING && (
|
|
40
46
|
<BankAccountText color={themeValues.textColor}>
|
|
@@ -14,7 +14,7 @@ export const CreditCardWrapper = styled.div`
|
|
|
14
14
|
`;
|
|
15
15
|
|
|
16
16
|
export const CCIconWrapper = styled.div`
|
|
17
|
-
margin-right:
|
|
17
|
+
margin-right: 8px;
|
|
18
18
|
width: 36px;
|
|
19
19
|
height: auto;
|
|
20
20
|
display: flex;
|
|
@@ -30,36 +30,36 @@ const FormattedCreditCard = ({
|
|
|
30
30
|
}) => {
|
|
31
31
|
const { isMobile } = useContext(ThemeContext);
|
|
32
32
|
return (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
33
|
+
<CreditCardWrapper>
|
|
34
|
+
<CCIconWrapper>
|
|
35
|
+
<CardType type={type} size={isMobile ? "small" : "large"} />
|
|
36
|
+
</CCIconWrapper>
|
|
37
|
+
<Stack childGap="0">
|
|
38
|
+
<Box padding="0">
|
|
39
|
+
<Text
|
|
40
|
+
variant="p"
|
|
41
|
+
padding="0"
|
|
42
|
+
color={themeValues.textColor}
|
|
43
|
+
textAlign="left"
|
|
44
|
+
extraStyles={`display: inline-block;`}
|
|
45
|
+
>
|
|
46
|
+
{`Card ending in ${lastFour}`}
|
|
47
|
+
</Text>
|
|
48
|
+
{expireDate && (
|
|
49
|
+
<Fragment>
|
|
50
|
+
{renderCardStatus(expirationStatus, expireDate, "left", "p")}
|
|
51
|
+
</Fragment>
|
|
52
|
+
)}
|
|
53
|
+
</Box>
|
|
54
|
+
{autoPay && (
|
|
55
|
+
<Text
|
|
56
|
+
variant="p"
|
|
57
|
+
color={themeValues.autopayTextColor}
|
|
58
|
+
extraStyles={`font-style: italic; font-size: .75rem;`}
|
|
59
|
+
>{`Autopay On`}</Text>
|
|
52
60
|
)}
|
|
53
|
-
</
|
|
54
|
-
|
|
55
|
-
<Text
|
|
56
|
-
variant="p"
|
|
57
|
-
color={themeValues.autopayTextColor}
|
|
58
|
-
extraStyles={`font-style: italic; font-size: .75rem;`}
|
|
59
|
-
>{`Autopay On`}</Text>
|
|
60
|
-
)}
|
|
61
|
-
</Stack>
|
|
62
|
-
</CreditCardWrapper>
|
|
61
|
+
</Stack>
|
|
62
|
+
</CreditCardWrapper>
|
|
63
63
|
);
|
|
64
64
|
};
|
|
65
65
|
export default themeComponent(
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
import { Box, Stack } from "../../atoms/layouts";
|
|
7
7
|
import Placeholder from "../../atoms/placeholder";
|
|
8
8
|
import ButtonWithAction from "../../atoms/button-with-action";
|
|
9
|
-
import { InternalLink } from "../../atoms/link";
|
|
10
9
|
import Text from "../../atoms/text";
|
|
11
10
|
import Title from "../../atoms/title";
|
|
12
11
|
import {
|
|
@@ -43,8 +42,7 @@ const EditableList = ({
|
|
|
43
42
|
qaPrefix,
|
|
44
43
|
ariaLabel,
|
|
45
44
|
editItemAriaRole = "",
|
|
46
|
-
disablePlaceholder = false
|
|
47
|
-
getEditHref = null
|
|
45
|
+
disablePlaceholder = false
|
|
48
46
|
}) => {
|
|
49
47
|
const addText = `Add a${
|
|
50
48
|
itemName[0].match(/[aieouAIEOU]/) ? "n" : ""
|
|
@@ -152,25 +150,14 @@ const EditableList = ({
|
|
|
152
150
|
dataQa={qaPrefix + " Edit"}
|
|
153
151
|
key={`Edit ${item.id}`}
|
|
154
152
|
>
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
</InternalLink>
|
|
164
|
-
) : (
|
|
165
|
-
<ButtonWithAction
|
|
166
|
-
variant="smallGhost"
|
|
167
|
-
text="Edit"
|
|
168
|
-
action={() => editItem(item.id)}
|
|
169
|
-
extraStyles={`min-width: 0;`}
|
|
170
|
-
aria-label={`Edit ${ariaLabel || itemName}`}
|
|
171
|
-
role={editItemAriaRole}
|
|
172
|
-
/>
|
|
173
|
-
)}
|
|
153
|
+
<ButtonWithAction
|
|
154
|
+
variant="smallGhost"
|
|
155
|
+
text="Edit"
|
|
156
|
+
action={() => editItem(item.id)}
|
|
157
|
+
extraStyles={`min-width: 0;`}
|
|
158
|
+
aria-label={`Edit ${ariaLabel || itemName}`}
|
|
159
|
+
role={editItemAriaRole}
|
|
160
|
+
/>
|
|
174
161
|
</Box>
|
|
175
162
|
)}
|
|
176
163
|
</EditableListItemControls>
|