@thecb/components 5.8.1-beta.1 → 5.8.1-beta.4

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.1",
3
+ "version": "5.8.1-beta.4",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -31,7 +31,7 @@ const Obligation = ({
31
31
  inactiveLookupValue = ""
32
32
  }) => {
33
33
  const obligation = obligations[0];
34
- const { customAttributes } = obligation;
34
+ const customAttributes = obligation?.customAttributes ?? {};
35
35
  const boxShadowValue =
36
36
  "0px 4px 4px rgba(41, 42, 51, 0.1), 0px 1px 1px 2px rgba(41, 42, 51, 0.1);";
37
37
  const activeObligation = (
@@ -40,11 +40,16 @@ const Obligation = ({
40
40
  borderRadius="4px"
41
41
  boxShadow={boxShadowValue}
42
42
  as="section"
43
- aria-label={`${obligation.description} ${obligation.subDescription}`}
43
+ aria-label={`${obligation?.description ??
44
+ "account"} ${obligation?.subDescription ?? obligationAssocID}`}
44
45
  >
45
46
  <Box background={WHITE}>
46
47
  <Stack childGap="14px">
47
- <Box key={`${obligations[0].id}-top`} padding="0 8px" minWidth="100%">
48
+ <Box
49
+ key={`${obligations?.[0].id}-top`}
50
+ padding="0 8px"
51
+ minWidth="100%"
52
+ >
48
53
  <Cluster
49
54
  justify="space-between"
50
55
  align="center"
@@ -63,8 +68,8 @@ const Obligation = ({
63
68
  />
64
69
  )}
65
70
  <TitleModule
66
- title={obligation.description}
67
- subtitle={obligation.subDescription}
71
+ title={obligation?.description}
72
+ subtitle={obligation?.subDescription}
68
73
  titleColor={BRIGHT_GREY}
69
74
  isMobile={isMobile}
70
75
  />
@@ -72,7 +77,7 @@ const Obligation = ({
72
77
  </Box>
73
78
  {!isMobile && (
74
79
  <AmountModule
75
- totalAmountDue={obligations.reduce(
80
+ totalAmountDue={obligations?.reduce(
76
81
  (acc, curr) => acc + curr.amountDue,
77
82
  0
78
83
  )}
@@ -137,7 +142,7 @@ const Obligation = ({
137
142
  >
138
143
  <Box background={ATHENS_GREY}>
139
144
  <Stack childGap="14px">
140
- <Box key={`${obligations[0].id}-top`} padding="0 8px" minWidth="100%">
145
+ <Box key={`${obligationAssocID}-top`} padding="0 8px" minWidth="100%">
141
146
  <Cluster
142
147
  justify="space-between"
143
148
  align="center"