@thecb/components 10.3.3-beta.0 → 10.3.3-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 +29 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +29 -17
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/payment-details/PaymentDetails.js +47 -26
- package/src/components/molecules/payment-details/PaymentDetails.stories.js +2 -0
package/package.json
CHANGED
|
@@ -34,9 +34,12 @@ const PaymentDetailsContent = ({
|
|
|
34
34
|
voidableTransactionDetails,
|
|
35
35
|
voidableAmountPaid,
|
|
36
36
|
partialVoidAction,
|
|
37
|
-
remainingBalance
|
|
37
|
+
remainingBalance,
|
|
38
|
+
agencySubheading,
|
|
39
|
+
isCollapsible
|
|
38
40
|
}) => (
|
|
39
41
|
<Stack childGap="16px">
|
|
42
|
+
{isCollapsible && agencySubheading}
|
|
40
43
|
{lineItemElems}
|
|
41
44
|
{hasVoidablePaymentsSection && (
|
|
42
45
|
<Box background={ATHENS_GREY}>
|
|
@@ -257,7 +260,7 @@ const PaymentDetails = ({
|
|
|
257
260
|
// end partial void section
|
|
258
261
|
isLoading = false,
|
|
259
262
|
isError = false,
|
|
260
|
-
multiCartEnabled,
|
|
263
|
+
multiCartEnabled = false,
|
|
261
264
|
agencyDisplayName
|
|
262
265
|
}) => {
|
|
263
266
|
const [isOpen, setIsOpen] = useState(initiallyOpen);
|
|
@@ -287,6 +290,30 @@ const PaymentDetails = ({
|
|
|
287
290
|
/>
|
|
288
291
|
</Fragment>
|
|
289
292
|
));
|
|
293
|
+
const agencySubheading = (
|
|
294
|
+
<>
|
|
295
|
+
{multiCartEnabled && agencyDisplayName && (
|
|
296
|
+
<Cluster
|
|
297
|
+
justify="space-between"
|
|
298
|
+
align="center"
|
|
299
|
+
style={{ margin: isCollapsible ? "0" : "0.5rem 0" }}
|
|
300
|
+
>
|
|
301
|
+
<Title
|
|
302
|
+
weight={FONT_WEIGHT_REGULAR}
|
|
303
|
+
as="h3"
|
|
304
|
+
extraStyles={`font-size: 1rem;`}
|
|
305
|
+
>
|
|
306
|
+
{agencyDisplayName}
|
|
307
|
+
</Title>
|
|
308
|
+
{lineItems?.length && (
|
|
309
|
+
<Text variant="pS" color={themeValues.text} weight="400">
|
|
310
|
+
{`${lineItems.length} item${lineItems.length > 1 ? "s" : ""}`}
|
|
311
|
+
</Text>
|
|
312
|
+
)}
|
|
313
|
+
</Cluster>
|
|
314
|
+
)}
|
|
315
|
+
</>
|
|
316
|
+
);
|
|
290
317
|
const content = isCollapsible ? (
|
|
291
318
|
<Stack childGap="0">
|
|
292
319
|
<Box padding="4.5px" />
|
|
@@ -304,7 +331,9 @@ const PaymentDetails = ({
|
|
|
304
331
|
voidableTransactionDetails,
|
|
305
332
|
voidableAmountPaid,
|
|
306
333
|
partialVoidAction,
|
|
307
|
-
remainingBalance
|
|
334
|
+
remainingBalance,
|
|
335
|
+
agencySubheading,
|
|
336
|
+
isCollapsible
|
|
308
337
|
}}
|
|
309
338
|
/>
|
|
310
339
|
</Stack>
|
|
@@ -321,7 +350,9 @@ const PaymentDetails = ({
|
|
|
321
350
|
voidableTransactionDetails,
|
|
322
351
|
voidableAmountPaid,
|
|
323
352
|
partialVoidAction,
|
|
324
|
-
remainingBalance
|
|
353
|
+
remainingBalance,
|
|
354
|
+
agencySubheading,
|
|
355
|
+
isCollapsible
|
|
325
356
|
}}
|
|
326
357
|
/>
|
|
327
358
|
);
|
|
@@ -348,28 +379,18 @@ const PaymentDetails = ({
|
|
|
348
379
|
</Cluster>
|
|
349
380
|
</Box>
|
|
350
381
|
) : (
|
|
351
|
-
|
|
352
|
-
<
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
<Title
|
|
364
|
-
weight={FONT_WEIGHT_SEMIBOLD}
|
|
365
|
-
as="h3"
|
|
366
|
-
extraStyles={`font-size: 1.375rem;`}
|
|
367
|
-
>
|
|
368
|
-
{agencyDisplayName}
|
|
369
|
-
</Title>
|
|
370
|
-
)}
|
|
371
|
-
</Cluster>
|
|
372
|
-
</Box>
|
|
382
|
+
<>
|
|
383
|
+
<Title
|
|
384
|
+
as="h2"
|
|
385
|
+
weight={FONT_WEIGHT_BOLD}
|
|
386
|
+
margin="1rem 0 0 0"
|
|
387
|
+
extraStyles={`font-size: 1.75rem;`}
|
|
388
|
+
id="payment-details-title"
|
|
389
|
+
>
|
|
390
|
+
{titleText}
|
|
391
|
+
</Title>
|
|
392
|
+
{agencySubheading}
|
|
393
|
+
</>
|
|
373
394
|
);
|
|
374
395
|
return isCollapsible ? (
|
|
375
396
|
<Collapsible
|
|
@@ -160,6 +160,8 @@ export const paymentDetails = () => (
|
|
|
160
160
|
collapsibleOnMobile={boolean("collapsibleOnMobile", false, "props")}
|
|
161
161
|
initiallyOpen={boolean("initiallyOpen", true, "props")}
|
|
162
162
|
hideTitle={boolean("hideTitle", false, "props")}
|
|
163
|
+
multiCartEnabled={true}
|
|
164
|
+
agencyDisplayName="Office of Charitable Donations"
|
|
163
165
|
/>
|
|
164
166
|
);
|
|
165
167
|
|