@thecb/components 7.12.2-beta.9 → 7.12.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/dist/index.cjs.js +1543 -730
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1543 -730
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/alert/Alert.js +4 -17
- package/src/components/atoms/icons/AutopayOnIcon.js +2 -2
- package/src/components/atoms/spinner/Spinner.js +4 -26
- package/src/components/molecules/payment-button-bar/PaymentButtonBar.js +3 -0
- package/src/components/molecules/payment-details/PaymentDetails.js +9 -84
- package/src/util/generateShadows.js +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/molecules/.DS_Store +0 -0
- /package/src/components/atoms/icons/{ExternalLinkicon.js → ExternalLinkIcon.js} +0 -0
package/package.json
CHANGED
|
@@ -4,7 +4,6 @@ import { Box, Center, Cluster, Stack, Cover, Sidebar } from "../layouts";
|
|
|
4
4
|
import Text from "../text";
|
|
5
5
|
import { fallbackValues } from "./Alert.theme";
|
|
6
6
|
import { themeComponent } from "../../../util/themeUtils";
|
|
7
|
-
import { generateShadows } from "../../../util/generateShadows";
|
|
8
7
|
|
|
9
8
|
const Alert = ({
|
|
10
9
|
heading,
|
|
@@ -18,16 +17,9 @@ const Alert = ({
|
|
|
18
17
|
showQuitLink = true,
|
|
19
18
|
themeValues,
|
|
20
19
|
extraStyles,
|
|
21
|
-
maxContentWidth
|
|
22
|
-
noBorder = false,
|
|
23
|
-
enableBoxShadow = false,
|
|
24
|
-
enableSmallText = false,
|
|
25
|
-
innerContentPadding = "1rem"
|
|
20
|
+
maxContentWidth
|
|
26
21
|
}) => {
|
|
27
22
|
const Icon = AlertIcons[variant];
|
|
28
|
-
let contentPadding = maxContentWidth
|
|
29
|
-
? `${padding} 1rem`
|
|
30
|
-
: innerContentPadding;
|
|
31
23
|
|
|
32
24
|
const content = (
|
|
33
25
|
<Sidebar width="24px" childGap="0rem">
|
|
@@ -40,17 +32,13 @@ const Alert = ({
|
|
|
40
32
|
</Box>
|
|
41
33
|
<Box padding="0">
|
|
42
34
|
<Sidebar sidebarOnRight width="24px" childGap="0rem">
|
|
43
|
-
<Box padding={
|
|
35
|
+
<Box padding={maxContentWidth ? `${padding} 1rem` : "1rem"}>
|
|
44
36
|
<Cluster justify="flex-start" align="center">
|
|
45
37
|
{textOverride ? (
|
|
46
38
|
textOverride
|
|
47
39
|
) : (
|
|
48
40
|
<Stack fullHeight childGap="0.25rem">
|
|
49
|
-
<Text
|
|
50
|
-
variant={enableSmallText ? "pS" : "p"}
|
|
51
|
-
color={themeValues.text}
|
|
52
|
-
weight="600"
|
|
53
|
-
>
|
|
41
|
+
<Text variant="p" color={themeValues.text} weight="600">
|
|
54
42
|
{heading}
|
|
55
43
|
</Text>
|
|
56
44
|
<Text variant="pS" color={themeValues.text}>
|
|
@@ -82,8 +70,7 @@ const Alert = ({
|
|
|
82
70
|
background={themeValues.background}
|
|
83
71
|
borderRadius="4px"
|
|
84
72
|
borderColor={themeValues.border}
|
|
85
|
-
borderSize=
|
|
86
|
-
boxShadow={enableBoxShadow ? generateShadows()?.inset?.base : ""}
|
|
73
|
+
borderSize="1px"
|
|
87
74
|
extraStyles={extraStyles}
|
|
88
75
|
>
|
|
89
76
|
{maxContentWidth ? (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SEA_GREEN } from "../../../constants/colors";
|
|
3
3
|
|
|
4
|
-
const AutopayOnIcon = () => (
|
|
4
|
+
const AutopayOnIcon = (color = SEA_GREEN) => (
|
|
5
5
|
<svg
|
|
6
6
|
xmlns="http://www.w3.org/2000/svg"
|
|
7
7
|
width="12"
|
|
@@ -11,7 +11,7 @@ const AutopayOnIcon = () => (
|
|
|
11
11
|
<g fill="none" fillRule="evenodd" stroke="none" strokeWidth="1">
|
|
12
12
|
<path
|
|
13
13
|
className="autopayIcon"
|
|
14
|
-
fill={
|
|
14
|
+
fill={color}
|
|
15
15
|
fillRule="nonzero"
|
|
16
16
|
d="M1.898 5.75c.079 0 .141-.02.188-.059a.281.281 0 00.094-.152 3.825 3.825 0 011.394-2.144A3.838 3.838 0 016 2.563c.5 0 .98.09 1.441.27.461.179.88.44 1.254.784l-.984.985A.542.542 0 007.547 5c0 .156.055.29.164.398.11.11.242.165.398.165h3.141c.156 0 .289-.055.398-.165A.542.542 0 0011.812 5V1.86a.542.542 0 00-.164-.399.542.542 0 00-.398-.164.542.542 0 00-.398.164l-.844.844A5.699 5.699 0 006 .688c-.938 0-1.809.207-2.613.62-.805.415-1.48.981-2.028 1.7A5.726 5.726 0 00.281 5.422a.265.265 0 00.059.223c.055.07.129.105.222.105h1.336zM6 12.312c.937 0 1.809-.207 2.613-.62a5.919 5.919 0 002.028-1.7 5.726 5.726 0 001.078-2.414.265.265 0 00-.059-.223.267.267 0 00-.223-.105h-1.335c-.079 0-.141.02-.188.059a.281.281 0 00-.094.152 3.825 3.825 0 01-1.394 2.144c-.711.555-1.52.833-2.426.833-.5 0-.98-.09-1.441-.27a3.985 3.985 0 01-1.254-.785l.984-.985A.542.542 0 004.453 8a.542.542 0 00-.164-.398.542.542 0 00-.398-.164H.75a.542.542 0 00-.398.164A.542.542 0 00.187 8v3.14c0 .157.055.29.165.4.109.108.242.163.398.163.156 0 .29-.055.398-.164l.844-.844A5.699 5.699 0 006 12.312z"
|
|
17
17
|
></path>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import styled
|
|
2
|
+
import styled from "styled-components";
|
|
3
3
|
import { fallbackValues } from "./Spinner.theme";
|
|
4
4
|
import { themeComponent } from "../../../util/themeUtils";
|
|
5
5
|
|
|
@@ -32,12 +32,6 @@ const SpinnerSvgAnimation = styled.svg`
|
|
|
32
32
|
stroke-dashoffset: -124;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
${({ centerSpinner }) =>
|
|
36
|
-
centerSpinner
|
|
37
|
-
? css`
|
|
38
|
-
margin: 0;
|
|
39
|
-
`
|
|
40
|
-
: ""}
|
|
41
35
|
`;
|
|
42
36
|
|
|
43
37
|
export const SpinnerContainer = styled.div`
|
|
@@ -47,27 +41,11 @@ export const SpinnerContainer = styled.div`
|
|
|
47
41
|
align-items: center;
|
|
48
42
|
justify-content: center;
|
|
49
43
|
line-height: 1;
|
|
50
|
-
${({ centerSpinner, size }) =>
|
|
51
|
-
centerSpinner
|
|
52
|
-
? css`
|
|
53
|
-
width: ${size}px;
|
|
54
|
-
height: ${size}px;
|
|
55
|
-
`
|
|
56
|
-
: ""}
|
|
57
44
|
`;
|
|
58
45
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*/
|
|
63
|
-
|
|
64
|
-
const Spinner = ({ size = "24", centerSpinner = false, themeValues }) => (
|
|
65
|
-
<SpinnerContainer centerSpinner={centerSpinner} size={size}>
|
|
66
|
-
<SpinnerSvgAnimation
|
|
67
|
-
size={size}
|
|
68
|
-
color={themeValues.color}
|
|
69
|
-
centerSpinner={centerSpinner}
|
|
70
|
-
>
|
|
46
|
+
const Spinner = ({ size = "24", themeValues }) => (
|
|
47
|
+
<SpinnerContainer>
|
|
48
|
+
<SpinnerSvgAnimation size={size} color={themeValues.color}>
|
|
71
49
|
<circle
|
|
72
50
|
className="path"
|
|
73
51
|
cx="50"
|
|
@@ -7,6 +7,7 @@ import { Box, Cluster } from "../../atoms/layouts";
|
|
|
7
7
|
import SolidDivider from "../../atoms/solid-divider";
|
|
8
8
|
|
|
9
9
|
const PaymentButtonBar = ({
|
|
10
|
+
isForwardButtonDisabled = false,
|
|
10
11
|
forwardButtonText = "Next",
|
|
11
12
|
forwardButtonAction,
|
|
12
13
|
forwardButtonLoading,
|
|
@@ -51,6 +52,7 @@ const PaymentButtonBar = ({
|
|
|
51
52
|
variant={forwardButtonVariant}
|
|
52
53
|
extraStyles={isMobile && "flex-grow: 1"}
|
|
53
54
|
dataQa={redirectText}
|
|
55
|
+
disabled={isForwardButtonDisabled}
|
|
54
56
|
/>
|
|
55
57
|
) : (
|
|
56
58
|
forwardButtonAction && (
|
|
@@ -61,6 +63,7 @@ const PaymentButtonBar = ({
|
|
|
61
63
|
isLoading={forwardButtonLoading}
|
|
62
64
|
extraStyles={isMobile && "flex-grow: 1"}
|
|
63
65
|
dataQa={forwardButtonText}
|
|
66
|
+
disabled={isForwardButtonDisabled}
|
|
64
67
|
/>
|
|
65
68
|
)
|
|
66
69
|
);
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import React, { useState, Fragment } from "react";
|
|
2
|
-
import {
|
|
3
|
-
Stack,
|
|
4
|
-
Cluster,
|
|
5
|
-
Box,
|
|
6
|
-
Motion,
|
|
7
|
-
Cover,
|
|
8
|
-
Center
|
|
9
|
-
} from "../../atoms/layouts";
|
|
2
|
+
import { Stack, Cluster, Box, Motion } from "../../atoms/layouts";
|
|
10
3
|
import { fallbackValues } from "./PaymentDetails.theme";
|
|
11
4
|
|
|
12
5
|
import { displayCurrency } from "../../../util/general";
|
|
@@ -21,11 +14,9 @@ import {
|
|
|
21
14
|
FONT_WEIGHT_BOLD,
|
|
22
15
|
FONT_WEIGHT_REGULAR
|
|
23
16
|
} from "../../../constants/style_constants";
|
|
24
|
-
import { ATHENS_GREY
|
|
17
|
+
import { ATHENS_GREY } from "../../../constants/colors";
|
|
25
18
|
import ButtonWithAction from "../../atoms/button-with-action";
|
|
26
19
|
import Text from "../../atoms/text";
|
|
27
|
-
import Alert from "../../atoms/alert";
|
|
28
|
-
import Spinner from "../../atoms/spinner";
|
|
29
20
|
import { noop } from "../../../util/general";
|
|
30
21
|
|
|
31
22
|
const PaymentDetailsContent = ({
|
|
@@ -119,60 +110,7 @@ const PaymentDetailsContent = ({
|
|
|
119
110
|
</Stack>
|
|
120
111
|
);
|
|
121
112
|
|
|
122
|
-
const
|
|
123
|
-
<Box
|
|
124
|
-
padding="0"
|
|
125
|
-
background={GRECIAN_GREY}
|
|
126
|
-
borderRadius="4px"
|
|
127
|
-
minHeight="196px"
|
|
128
|
-
>
|
|
129
|
-
<Cover minHeight="196px" singleChild fillCenter>
|
|
130
|
-
<Center intrinsic>
|
|
131
|
-
<Box
|
|
132
|
-
padding="0"
|
|
133
|
-
extraStyles={`flex-grow: 1; display: flex; justify-content: center; align-items: center;`}
|
|
134
|
-
>
|
|
135
|
-
<Spinner size="100" centerSpinner />
|
|
136
|
-
</Box>
|
|
137
|
-
</Center>
|
|
138
|
-
</Cover>
|
|
139
|
-
</Box>
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
const ErrorDetails = () => (
|
|
143
|
-
<Box padding="0">
|
|
144
|
-
<Alert
|
|
145
|
-
variant="error"
|
|
146
|
-
heading="Error Loading Payment"
|
|
147
|
-
text="Please go back and try again."
|
|
148
|
-
showQuitLink={false}
|
|
149
|
-
noBorder
|
|
150
|
-
enableBoxShadow
|
|
151
|
-
enableSmallText
|
|
152
|
-
innerContentPadding="0 16px"
|
|
153
|
-
extraStyles={`min-height: 67px; height: 67px;`}
|
|
154
|
-
/>
|
|
155
|
-
</Box>
|
|
156
|
-
);
|
|
157
|
-
|
|
158
|
-
const getLoadingOrErrorContent = (isLoading = false, isError = false) => {
|
|
159
|
-
if (isLoading) {
|
|
160
|
-
return <LoadingDetails />;
|
|
161
|
-
} else if (isError) {
|
|
162
|
-
return <ErrorDetails />;
|
|
163
|
-
}
|
|
164
|
-
return <Fragment />;
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
const Collapsible = ({
|
|
168
|
-
content,
|
|
169
|
-
title,
|
|
170
|
-
supportsTouch,
|
|
171
|
-
isOpen,
|
|
172
|
-
setIsOpen,
|
|
173
|
-
isLoading = false,
|
|
174
|
-
isError = false
|
|
175
|
-
}) => (
|
|
113
|
+
const Collapsible = ({ content, title, supportsTouch, isOpen, setIsOpen }) => (
|
|
176
114
|
<CollapsibleSection
|
|
177
115
|
isMobile={true}
|
|
178
116
|
supportsTouch={supportsTouch}
|
|
@@ -191,24 +129,15 @@ const Collapsible = ({
|
|
|
191
129
|
positionTransition
|
|
192
130
|
initial={"closed"}
|
|
193
131
|
>
|
|
194
|
-
{
|
|
195
|
-
? getLoadingOrErrorContent(isLoading, isError)
|
|
196
|
-
: content}
|
|
132
|
+
{content}
|
|
197
133
|
</Motion>
|
|
198
134
|
</CollapsibleSection>
|
|
199
135
|
);
|
|
200
136
|
|
|
201
|
-
const NonCollapsible = ({
|
|
202
|
-
title,
|
|
203
|
-
content,
|
|
204
|
-
isLoading = false,
|
|
205
|
-
isError = false
|
|
206
|
-
}) => (
|
|
137
|
+
const NonCollapsible = ({ title, content }) => (
|
|
207
138
|
<Stack>
|
|
208
139
|
{title}
|
|
209
|
-
{
|
|
210
|
-
? getLoadingOrErrorContent(isLoading, isError)
|
|
211
|
-
: content}
|
|
140
|
+
{content}
|
|
212
141
|
</Stack>
|
|
213
142
|
);
|
|
214
143
|
|
|
@@ -230,10 +159,8 @@ const PaymentDetails = ({
|
|
|
230
159
|
voidableTransactionDetails = [],
|
|
231
160
|
partialVoidAction = noop,
|
|
232
161
|
voidableAmountPaid = 0,
|
|
233
|
-
remainingBalance = false
|
|
162
|
+
remainingBalance = false
|
|
234
163
|
// end partial void section
|
|
235
|
-
isLoading = false,
|
|
236
|
-
isError = false
|
|
237
164
|
}) => {
|
|
238
165
|
const [isOpen, setIsOpen] = useState(initiallyOpen);
|
|
239
166
|
const fees = _fees
|
|
@@ -339,13 +266,11 @@ const PaymentDetails = ({
|
|
|
339
266
|
isOpen,
|
|
340
267
|
setIsOpen,
|
|
341
268
|
isMobile,
|
|
342
|
-
supportsTouch
|
|
343
|
-
isLoading,
|
|
344
|
-
isError
|
|
269
|
+
supportsTouch
|
|
345
270
|
}}
|
|
346
271
|
/>
|
|
347
272
|
) : (
|
|
348
|
-
<NonCollapsible {...{ title, content
|
|
273
|
+
<NonCollapsible {...{ title, content }} />
|
|
349
274
|
);
|
|
350
275
|
};
|
|
351
276
|
|
|
@@ -28,7 +28,7 @@ const rgbToRgba = (rgbValue = "", opacity = "") => {
|
|
|
28
28
|
)}, ${opacity}${rgbValue.slice(-1)}`;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export const generateShadows =
|
|
31
|
+
export const generateShadows = baseColorRGB => {
|
|
32
32
|
const colorTen = rgbToRgba(baseColorRGB, "0.1") || "rgba(41, 42, 51, 0.1)";
|
|
33
33
|
const colorTwenty = rgbToRgba(baseColorRGB, "0.2") || "rgba(41, 42, 51, 0.2)";
|
|
34
34
|
const colorTwentyFive =
|
package/src/.DS_Store
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|