@thecb/components 5.8.1-beta.3 → 5.8.1-beta.6

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": "5.8.1-beta.3",
3
+ "version": "5.8.1-beta.6",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -30,8 +30,16 @@ const Obligation = ({
30
30
  inactiveLookupInput = "Account",
31
31
  inactiveLookupValue = ""
32
32
  }) => {
33
- const obligation = obligations[0];
34
- const customAttributes = obligation?.customAttributes ?? {};
33
+ /*
34
+ The value of obligations is always an array. It can contain:
35
+ - A single obligation
36
+ - A group of obligations (a "collection")
37
+
38
+ The top level desc/subdesc for all obligations in a collection is the same
39
+ (Collection accounts look different in the Account Details page)
40
+ */
41
+ const firstObligation = obligations[0];
42
+ const customAttributes = firstObligation?.customAttributes ?? {};
35
43
  const boxShadowValue =
36
44
  "0px 4px 4px rgba(41, 42, 51, 0.1), 0px 1px 1px 2px rgba(41, 42, 51, 0.1);";
37
45
  const activeObligation = (
@@ -40,11 +48,16 @@ const Obligation = ({
40
48
  borderRadius="4px"
41
49
  boxShadow={boxShadowValue}
42
50
  as="section"
43
- aria-label={`${obligation.description} ${obligation.subDescription}`}
51
+ aria-label={`${firstObligation?.description ??
52
+ "account"} ${firstObligation?.subDescription ?? obligationAssocID}`}
44
53
  >
45
- <Box background={WHITE}>
54
+ <Box background={WHITE} padding="24px 16px">
46
55
  <Stack childGap="14px">
47
- <Box key={`${obligations[0].id}-top`} padding="0 8px" minWidth="100%">
56
+ <Box
57
+ key={`${firstObligation?.id}-top`}
58
+ padding="0 8px"
59
+ minWidth="100%"
60
+ >
48
61
  <Cluster
49
62
  justify="space-between"
50
63
  align="center"
@@ -63,8 +76,8 @@ const Obligation = ({
63
76
  />
64
77
  )}
65
78
  <TitleModule
66
- title={obligation.description}
67
- subtitle={obligation.subDescription}
79
+ title={firstObligation?.description}
80
+ subtitle={firstObligation?.subDescription}
68
81
  titleColor={BRIGHT_GREY}
69
82
  isMobile={isMobile}
70
83
  />
@@ -72,7 +85,7 @@ const Obligation = ({
72
85
  </Box>
73
86
  {!isMobile && (
74
87
  <AmountModule
75
- totalAmountDue={obligations.reduce(
88
+ totalAmountDue={obligations?.reduce(
76
89
  (acc, curr) => acc + curr.amountDue,
77
90
  0
78
91
  )}
@@ -137,7 +150,7 @@ const Obligation = ({
137
150
  >
138
151
  <Box background={ATHENS_GREY}>
139
152
  <Stack childGap="14px">
140
- <Box key={`${obligations[0].id}-top`} padding="0 8px" minWidth="100%">
153
+ <Box key={`${obligationAssocID}-top`} padding="0 8px" minWidth="100%">
141
154
  <Cluster
142
155
  justify="space-between"
143
156
  align="center"
@@ -74,7 +74,9 @@ const AutopayModal = ({
74
74
  toggleModal(true);
75
75
  }}
76
76
  dataQa="Turn off Autopay"
77
- extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
77
+ extraStyles={
78
+ isMobile ? `flex-grow: 1; width: 100%;` : `margin: 0px`
79
+ }
78
80
  />
79
81
  );
80
82
  }
@@ -25,7 +25,7 @@ const InactiveControlsModule = ({
25
25
  border={isMobile ? `1px solid ${GHOST_GREY}` : `0px`}
26
26
  borderWidthOverride={isMobile ? `1px 0 0 0` : `0px`}
27
27
  >
28
- <Cluster childGap={isMobile ? `8px` : `18px`}>
28
+ <Cluster childGap={isMobile ? `8px` : `16px`} nowrap>
29
29
  {autoPayEnabled && (
30
30
  <Box padding="0" extraStyles={`flex-grow: 1;`}>
31
31
  <AutopayModalModule
@@ -50,7 +50,9 @@ const InactiveControlsModule = ({
50
50
  text="Remove"
51
51
  action={handleRemoveAccount}
52
52
  dataQa="Remove Account"
53
- extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
53
+ extraStyles={
54
+ isMobile ? `flex-grow: 1; width: 100%;` : `margin: 0px;`
55
+ }
54
56
  />
55
57
  </Box>
56
58
  </Cluster>