@thecb/components 10.4.0 → 10.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "10.4.0",
3
+ "version": "10.4.1",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
package/src/.DS_Store CHANGED
Binary file
@@ -13,7 +13,8 @@ import Title from "../../atoms/title";
13
13
  import SolidDivider from "../../atoms/solid-divider";
14
14
  import {
15
15
  FONT_WEIGHT_BOLD,
16
- FONT_WEIGHT_REGULAR
16
+ FONT_WEIGHT_REGULAR,
17
+ FONT_WEIGHT_SEMIBOLD
17
18
  } from "../../../constants/style_constants";
18
19
  import { ATHENS_GREY } from "../../../constants/colors";
19
20
  import ButtonWithAction from "../../atoms/button-with-action";
@@ -33,9 +34,12 @@ const PaymentDetailsContent = ({
33
34
  voidableTransactionDetails,
34
35
  voidableAmountPaid,
35
36
  partialVoidAction,
36
- remainingBalance
37
+ remainingBalance,
38
+ agencySubheading,
39
+ isCollapsible
37
40
  }) => (
38
41
  <Stack childGap="16px">
42
+ {isCollapsible && agencySubheading}
39
43
  {lineItemElems}
40
44
  {hasVoidablePaymentsSection && (
41
45
  <Box background={ATHENS_GREY}>
@@ -255,7 +259,9 @@ const PaymentDetails = ({
255
259
  remainingBalance = false,
256
260
  // end partial void section
257
261
  isLoading = false,
258
- isError = false
262
+ isError = false,
263
+ multiCartEnabled = false,
264
+ agencyDisplayName
259
265
  }) => {
260
266
  const [isOpen, setIsOpen] = useState(initiallyOpen);
261
267
  const fees = _fees
@@ -284,6 +290,30 @@ const PaymentDetails = ({
284
290
  />
285
291
  </Fragment>
286
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
+ );
287
317
  const content = isCollapsible ? (
288
318
  <Stack childGap="0">
289
319
  <Box padding="4.5px" />
@@ -301,7 +331,9 @@ const PaymentDetails = ({
301
331
  voidableTransactionDetails,
302
332
  voidableAmountPaid,
303
333
  partialVoidAction,
304
- remainingBalance
334
+ remainingBalance,
335
+ agencySubheading,
336
+ isCollapsible
305
337
  }}
306
338
  />
307
339
  </Stack>
@@ -318,7 +350,9 @@ const PaymentDetails = ({
318
350
  voidableTransactionDetails,
319
351
  voidableAmountPaid,
320
352
  partialVoidAction,
321
- remainingBalance
353
+ remainingBalance,
354
+ agencySubheading,
355
+ isCollapsible
322
356
  }}
323
357
  />
324
358
  );
@@ -345,15 +379,18 @@ const PaymentDetails = ({
345
379
  </Cluster>
346
380
  </Box>
347
381
  ) : (
348
- <Title
349
- as="h2"
350
- weight={FONT_WEIGHT_BOLD}
351
- margin="1rem 0 0 0"
352
- extraStyles={`font-size: 1.75rem;`}
353
- id="payment-details-title"
354
- >
355
- {titleText}
356
- </Title>
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
+ </>
357
394
  );
358
395
  return isCollapsible ? (
359
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 Trust"
163
165
  />
164
166
  );
165
167