@thecb/components 7.12.2-beta.0 → 7.12.3-beta.0
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 +14 -58
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +14 -58
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/payment-button-bar/PaymentButtonBar.js +3 -0
- package/src/components/molecules/payment-details/PaymentDetails.js +8 -57
- package/src/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/molecules/.DS_Store +0 -0
package/package.json
CHANGED
|
@@ -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
|
);
|
|
@@ -14,11 +14,9 @@ import {
|
|
|
14
14
|
FONT_WEIGHT_BOLD,
|
|
15
15
|
FONT_WEIGHT_REGULAR
|
|
16
16
|
} from "../../../constants/style_constants";
|
|
17
|
-
import { ATHENS_GREY
|
|
17
|
+
import { ATHENS_GREY } from "../../../constants/colors";
|
|
18
18
|
import ButtonWithAction from "../../atoms/button-with-action";
|
|
19
19
|
import Text from "../../atoms/text";
|
|
20
|
-
import Alert from "../../atoms/alert";
|
|
21
|
-
import Spinner from "../../atoms/spinner";
|
|
22
20
|
import { noop } from "../../../util/general";
|
|
23
21
|
|
|
24
22
|
const PaymentDetailsContent = ({
|
|
@@ -112,41 +110,7 @@ const PaymentDetailsContent = ({
|
|
|
112
110
|
</Stack>
|
|
113
111
|
);
|
|
114
112
|
|
|
115
|
-
const
|
|
116
|
-
<Box padding="0" background={GHOST_GREY} borderRadius="4px">
|
|
117
|
-
<Spinner />
|
|
118
|
-
</Box>
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
const ErrorDetails = () => (
|
|
122
|
-
<Box padding="0">
|
|
123
|
-
<Alert
|
|
124
|
-
variant="error"
|
|
125
|
-
heading="Error Loading Payment"
|
|
126
|
-
text="Please go back and try again."
|
|
127
|
-
showQuitLink={false}
|
|
128
|
-
/>
|
|
129
|
-
</Box>
|
|
130
|
-
);
|
|
131
|
-
|
|
132
|
-
const getLoadingOrErrorContent = (isLoading = false, isError = false) => {
|
|
133
|
-
if (isLoading) {
|
|
134
|
-
return <LoadingDetails />;
|
|
135
|
-
} else if (isError) {
|
|
136
|
-
return <ErrorDetails />;
|
|
137
|
-
}
|
|
138
|
-
return <Fragment />;
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
const Collapsible = ({
|
|
142
|
-
content,
|
|
143
|
-
title,
|
|
144
|
-
supportsTouch,
|
|
145
|
-
isOpen,
|
|
146
|
-
setIsOpen,
|
|
147
|
-
isLoading = false,
|
|
148
|
-
isError = false
|
|
149
|
-
}) => (
|
|
113
|
+
const Collapsible = ({ content, title, supportsTouch, isOpen, setIsOpen }) => (
|
|
150
114
|
<CollapsibleSection
|
|
151
115
|
isMobile={true}
|
|
152
116
|
supportsTouch={supportsTouch}
|
|
@@ -165,24 +129,15 @@ const Collapsible = ({
|
|
|
165
129
|
positionTransition
|
|
166
130
|
initial={"closed"}
|
|
167
131
|
>
|
|
168
|
-
{
|
|
169
|
-
? getLoadingOrErrorContent(isLoading, isError)
|
|
170
|
-
: content}
|
|
132
|
+
{content}
|
|
171
133
|
</Motion>
|
|
172
134
|
</CollapsibleSection>
|
|
173
135
|
);
|
|
174
136
|
|
|
175
|
-
const NonCollapsible = ({
|
|
176
|
-
title,
|
|
177
|
-
content,
|
|
178
|
-
isLoading = false,
|
|
179
|
-
isError = false
|
|
180
|
-
}) => (
|
|
137
|
+
const NonCollapsible = ({ title, content }) => (
|
|
181
138
|
<Stack>
|
|
182
139
|
{title}
|
|
183
|
-
{
|
|
184
|
-
? getLoadingOrErrorContent(isLoading, isError)
|
|
185
|
-
: content}
|
|
140
|
+
{content}
|
|
186
141
|
</Stack>
|
|
187
142
|
);
|
|
188
143
|
|
|
@@ -204,10 +159,8 @@ const PaymentDetails = ({
|
|
|
204
159
|
voidableTransactionDetails = [],
|
|
205
160
|
partialVoidAction = noop,
|
|
206
161
|
voidableAmountPaid = 0,
|
|
207
|
-
remainingBalance = false
|
|
162
|
+
remainingBalance = false
|
|
208
163
|
// end partial void section
|
|
209
|
-
isLoading = false,
|
|
210
|
-
isError = false
|
|
211
164
|
}) => {
|
|
212
165
|
const [isOpen, setIsOpen] = useState(initiallyOpen);
|
|
213
166
|
const fees = _fees
|
|
@@ -313,13 +266,11 @@ const PaymentDetails = ({
|
|
|
313
266
|
isOpen,
|
|
314
267
|
setIsOpen,
|
|
315
268
|
isMobile,
|
|
316
|
-
supportsTouch
|
|
317
|
-
isLoading,
|
|
318
|
-
isError
|
|
269
|
+
supportsTouch
|
|
319
270
|
}}
|
|
320
271
|
/>
|
|
321
272
|
) : (
|
|
322
|
-
<NonCollapsible {...{ title, content
|
|
273
|
+
<NonCollapsible {...{ title, content }} />
|
|
323
274
|
);
|
|
324
275
|
};
|
|
325
276
|
|
package/src/.DS_Store
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|