@thecb/components 11.9.0 → 11.10.0-beta.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 +30 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +30 -12
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/card-type/CardType.js +9 -1
- package/src/components/atoms/formatted-credit-card/FormattedCreditCard.js +3 -3
- package/src/components/atoms/icons/AmExSmallIcon.js +2 -0
- package/src/components/atoms/icons/DiscoverSmallIcon.js +2 -0
- package/src/components/atoms/icons/GenericCardLarge.js +1 -1
- package/src/components/atoms/icons/GenericSmallIcon.js +2 -0
- package/src/components/atoms/icons/MasterCardSmallIcon.js +2 -0
- package/src/components/atoms/icons/VisaSmallIcon.js +2 -0
- package/src/components/molecules/radio-section/InnerRadioSection.js +2 -2
package/package.json
CHANGED
|
@@ -34,9 +34,17 @@ const cardBrands = {
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
const normalizeType = type => {
|
|
38
|
+
if (!type) return undefined;
|
|
39
|
+
const lower = type.toLowerCase();
|
|
40
|
+
if (lower === "mastercard") return "master_card";
|
|
41
|
+
return lower;
|
|
42
|
+
};
|
|
43
|
+
|
|
37
44
|
const CardType = ({ type, size = "small" }) => {
|
|
45
|
+
const normalizedType = normalizeType(type);
|
|
38
46
|
const { label, [size]: IconComponent } =
|
|
39
|
-
cardBrands[
|
|
47
|
+
cardBrands[normalizedType] || cardBrands.default;
|
|
40
48
|
return (
|
|
41
49
|
<span role="img" aria-label={label}>
|
|
42
50
|
<IconComponent />
|
|
@@ -15,7 +15,7 @@ export const CreditCardWrapper = styled.div`
|
|
|
15
15
|
|
|
16
16
|
export const CCIconWrapper = styled.div`
|
|
17
17
|
margin-right: 16px;
|
|
18
|
-
width:
|
|
18
|
+
width: 36px;
|
|
19
19
|
height: auto;
|
|
20
20
|
display: flex;
|
|
21
21
|
`;
|
|
@@ -30,13 +30,13 @@ const FormattedCreditCard = ({
|
|
|
30
30
|
}) => (
|
|
31
31
|
<CreditCardWrapper>
|
|
32
32
|
<CCIconWrapper>
|
|
33
|
-
<CardType type={type} />
|
|
33
|
+
<CardType type={type} size="large" />
|
|
34
34
|
</CCIconWrapper>
|
|
35
35
|
<Stack childGap="0">
|
|
36
36
|
<Box padding="0">
|
|
37
37
|
<Text
|
|
38
38
|
variant="p"
|
|
39
|
-
padding="0
|
|
39
|
+
padding="0"
|
|
40
40
|
color={themeValues.textColor}
|
|
41
41
|
textAlign="left"
|
|
42
42
|
extraStyles={`display: inline-block;`}
|
|
@@ -69,8 +69,8 @@ const InnerRadioSection = ({
|
|
|
69
69
|
`;
|
|
70
70
|
|
|
71
71
|
const RightIcon = styled.img`
|
|
72
|
-
height: ${({ isMobile }) => (isMobile ? "
|
|
73
|
-
width: ${({ isMobile }) => (isMobile ? "
|
|
72
|
+
height: ${({ isMobile }) => (isMobile ? "16px" : "24px")};
|
|
73
|
+
width: ${({ isMobile }) => (isMobile ? "24px" : "36px")};
|
|
74
74
|
${({ fade }) => fade && "opacity: 0.4;"}
|
|
75
75
|
transition: opacity 0.3s ease;
|
|
76
76
|
`;
|