@thecb/components 8.4.9-beta.0 → 8.4.9
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 +55 -19
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.esm.js +55 -19
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/form-select/FormSelect.js +0 -1
- package/src/components/atoms/radio-button-with-label/RadioButtonWithLabel.js +49 -33
- package/src/components/atoms/solid-divider/SolidDivider.js +4 -4
- package/src/components/molecules/module/Module.js +16 -8
- package/src/components/molecules/radio-group/RadioGroup.js +2 -0
- package/src/components/molecules/radio-group/RadioGroup.stories.js +1 -1
- package/src/components/molecules/radio-section/RadioSection.js +2 -0
- package/src/constants/colors.js +2 -0
- package/src/types/common/Field.ts +3 -3
- package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +0 -49322
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
package/package.json
CHANGED
|
@@ -57,30 +57,45 @@ const RadioButtonWithLabel = ({
|
|
|
57
57
|
ariaInvalid,
|
|
58
58
|
themeValues,
|
|
59
59
|
index,
|
|
60
|
-
handleChange = noop // optional, for custom event handling in ingesting app
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
60
|
+
handleChange = noop, // optional, for custom event handling in ingesting app
|
|
61
|
+
field,
|
|
62
|
+
config
|
|
63
|
+
}) => {
|
|
64
|
+
const getDefaultChecked = (value, idx) => {
|
|
65
|
+
const selectionExistsInConfig = config
|
|
66
|
+
.map(c => c.value)
|
|
67
|
+
.includes(field.rawValue);
|
|
68
|
+
|
|
69
|
+
if (selectionExistsInConfig) {
|
|
70
|
+
// if exists, selection comes from the redux-freeform state
|
|
71
|
+
return field.rawValue === value;
|
|
72
|
+
}
|
|
73
|
+
// fallback to first option as default selection
|
|
74
|
+
return idx === 0;
|
|
75
|
+
};
|
|
76
|
+
return (
|
|
77
|
+
<InputAndLabelContainer
|
|
78
|
+
align="center"
|
|
79
|
+
childGap="0.5rem"
|
|
80
|
+
activeColor={themeValues.activeColor}
|
|
81
|
+
>
|
|
82
|
+
<HiddenRadioInput
|
|
83
|
+
aria-invalid={ariaInvalid}
|
|
84
|
+
style={{ marginTop: 0 }}
|
|
85
|
+
type="radio"
|
|
86
|
+
name={groupName}
|
|
87
|
+
id={id}
|
|
88
|
+
value={value}
|
|
89
|
+
onChange={e => {
|
|
90
|
+
setValue(e.target.value);
|
|
91
|
+
handleChange(e);
|
|
92
|
+
}}
|
|
93
|
+
defaultChecked={getDefaultChecked(value, index)}
|
|
94
|
+
/>
|
|
95
|
+
<Text
|
|
96
|
+
as="label"
|
|
97
|
+
htmlFor={id}
|
|
98
|
+
extraStyles={`
|
|
84
99
|
font-size: 1rem;
|
|
85
100
|
display: flex;
|
|
86
101
|
width: 100%;
|
|
@@ -88,15 +103,16 @@ const RadioButtonWithLabel = ({
|
|
|
88
103
|
cursor: pointer;
|
|
89
104
|
}
|
|
90
105
|
`}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
);
|
|
106
|
+
>
|
|
107
|
+
<Circle
|
|
108
|
+
activeColor={themeValues.activeColor}
|
|
109
|
+
inactiveBorderColor={themeValues.inactiveBorderColor}
|
|
110
|
+
/>
|
|
111
|
+
{labelText}
|
|
112
|
+
</Text>
|
|
113
|
+
</InputAndLabelContainer>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
100
116
|
|
|
101
117
|
export default themeComponent(
|
|
102
118
|
RadioButtonWithLabel,
|
|
@@ -3,14 +3,14 @@ import { fallbackValues } from "./SolidDivider.theme";
|
|
|
3
3
|
import { themeComponent } from "../../../util/themeUtils";
|
|
4
4
|
import { Box } from "../layouts";
|
|
5
5
|
|
|
6
|
-
const SolidDivider = ({ themeValues }) => (
|
|
6
|
+
const SolidDivider = ({ borderColor, borderSize, themeValues }) => (
|
|
7
7
|
<Box
|
|
8
8
|
padding="0"
|
|
9
9
|
minWidth="100%"
|
|
10
10
|
minHeight="1px"
|
|
11
|
-
borderColor={themeValues.borderColor}
|
|
12
|
-
borderSize={themeValues.borderSize}
|
|
13
|
-
borderWidthOverride={`0px 0px ${themeValues.borderSize} 0px`}
|
|
11
|
+
borderColor={borderColor || themeValues.borderColor}
|
|
12
|
+
borderSize={borderSize || themeValues.borderSize}
|
|
13
|
+
borderWidthOverride={`0px 0px ${borderSize || themeValues.borderSize} 0px`}
|
|
14
14
|
/>
|
|
15
15
|
);
|
|
16
16
|
|
|
@@ -16,16 +16,18 @@ import { Box, Cluster } from "../../atoms/layouts";
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
const Module = ({
|
|
19
|
+
variant = "default",
|
|
20
|
+
as,
|
|
21
|
+
disabled,
|
|
19
22
|
heading,
|
|
23
|
+
rightTitleContent,
|
|
24
|
+
titleID = "",
|
|
20
25
|
spacing = "1rem",
|
|
21
26
|
padding = "0",
|
|
27
|
+
margin = "0",
|
|
22
28
|
spacingBottom = "2.5rem",
|
|
23
|
-
themeValues,
|
|
24
|
-
variant = "default",
|
|
25
29
|
fontSize,
|
|
26
|
-
|
|
27
|
-
titleID = "",
|
|
28
|
-
rightTitleContent,
|
|
30
|
+
themeValues,
|
|
29
31
|
children
|
|
30
32
|
}) => {
|
|
31
33
|
const themedFontSize =
|
|
@@ -38,6 +40,7 @@ const Module = ({
|
|
|
38
40
|
const themedElemType =
|
|
39
41
|
variant === "small" ? "h6" : variant === "default" ? "h5" : "h2";
|
|
40
42
|
const computedElemType = as || themedElemType;
|
|
43
|
+
const disabledStyles = "opacity: 0.40;";
|
|
41
44
|
const headingText = (
|
|
42
45
|
<Title
|
|
43
46
|
weight={themeValues.fontWeight}
|
|
@@ -53,7 +56,12 @@ const Module = ({
|
|
|
53
56
|
);
|
|
54
57
|
|
|
55
58
|
return (
|
|
56
|
-
<
|
|
59
|
+
<Box
|
|
60
|
+
aria-disabled={disabled}
|
|
61
|
+
extraStyles={disabled && disabledStyles}
|
|
62
|
+
padding="0"
|
|
63
|
+
role={"group"}
|
|
64
|
+
>
|
|
57
65
|
{heading && !rightTitleContent && headingText}
|
|
58
66
|
{heading && rightTitleContent && (
|
|
59
67
|
<Cluster justify="space-between" align="center" nowrap>
|
|
@@ -61,7 +69,7 @@ const Module = ({
|
|
|
61
69
|
{rightTitleContent}
|
|
62
70
|
</Cluster>
|
|
63
71
|
)}
|
|
64
|
-
<Box padding={`0 0 ${spacingBottom}`}>
|
|
72
|
+
<Box padding={`0 0 ${spacingBottom}`} extraStyles={`margin: ${margin}`}>
|
|
65
73
|
<Box
|
|
66
74
|
padding={padding}
|
|
67
75
|
background={themeValues.backgroundColor}
|
|
@@ -71,7 +79,7 @@ const Module = ({
|
|
|
71
79
|
{children}
|
|
72
80
|
</Box>
|
|
73
81
|
</Box>
|
|
74
|
-
</
|
|
82
|
+
</Box>
|
|
75
83
|
);
|
|
76
84
|
};
|
|
77
85
|
|
|
@@ -42,6 +42,7 @@ const RadioSection = ({
|
|
|
42
42
|
staggeredAnimation = false,
|
|
43
43
|
initiallyOpen = true,
|
|
44
44
|
openHeight = "auto",
|
|
45
|
+
containerStyles = "",
|
|
45
46
|
ariaDescribedBy
|
|
46
47
|
}) => {
|
|
47
48
|
const handleKeyDown = (id, e) => {
|
|
@@ -98,6 +99,7 @@ const RadioSection = ({
|
|
|
98
99
|
padding="1px"
|
|
99
100
|
border={`1px solid ${themeValues.borderColor}`}
|
|
100
101
|
borderRadius="4px"
|
|
102
|
+
extraStyles={containerStyles}
|
|
101
103
|
>
|
|
102
104
|
<Stack childGap="0">
|
|
103
105
|
{sections
|
package/src/constants/colors.js
CHANGED
|
@@ -36,6 +36,7 @@ const GRECIAN_GREY = "#E5E7EC"; // CBS-200
|
|
|
36
36
|
const BLACK_SQUEEZE = "#EAF2F7";
|
|
37
37
|
const GREY_CHATEAU = "#959CA8"; // CBS-500
|
|
38
38
|
const COOL_GREY_05 = "#fbfcfd"; // CBS-050
|
|
39
|
+
const MANATEE_GREY = "#878E9B"; // CB-60 (cool)
|
|
39
40
|
// BLUE
|
|
40
41
|
const CLOUDBURST_BLUE = "#26395c";
|
|
41
42
|
const ZODIAC_BLUE = "#14284b";
|
|
@@ -171,6 +172,7 @@ export {
|
|
|
171
172
|
CHARADE_GREY,
|
|
172
173
|
GRECIAN_GREY,
|
|
173
174
|
COOL_GREY_05,
|
|
175
|
+
MANATEE_GREY,
|
|
174
176
|
BLACK_SQUEEZE,
|
|
175
177
|
GREY_CHATEAU,
|
|
176
178
|
CLOUDBURST_BLUE,
|