@thecb/components 5.10.4 → 5.10.7

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.10.4",
3
+ "version": "5.10.7",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
package/src/.DS_Store ADDED
Binary file
@@ -108,7 +108,7 @@ const PaymentDetailsActions = ({
108
108
  variant="tertiary"
109
109
  text={`Set Up ${planType}`}
110
110
  action={() => {
111
- setDetailedObligation(obligations, config);
111
+ setDetailedObligation(obligations, config, obligationAssocID);
112
112
  handleAutopayAction();
113
113
  }}
114
114
  dataQa="Set Up Autopay"
@@ -29,13 +29,19 @@ const PaymentDetailsContent = ({
29
29
  hasVoidablePaymentsSection,
30
30
  voidableTransactionDetails,
31
31
  voidableAmountPaid,
32
- partialVoidAction
32
+ partialVoidAction,
33
+ remainingBalance
33
34
  }) => (
34
35
  <Stack childGap="16px">
35
36
  {lineItemElems}
36
37
  {hasVoidablePaymentsSection && (
37
38
  <Box background={ATHENS_GREY}>
38
- <Text variant="p" color={themeValues.text} weight="400">
39
+ <Text
40
+ variant="p"
41
+ color={themeValues.text}
42
+ weight="400"
43
+ fontSize="0.875rem"
44
+ >
39
45
  Paid
40
46
  </Text>
41
47
  {voidableTransactionDetails.map(t => (
@@ -46,7 +52,12 @@ const PaymentDetailsContent = ({
46
52
  variant="ghost"
47
53
  action={() => partialVoidAction(t)}
48
54
  text="Void"
49
- extraStyles={"min-width: 75px; margin: 0px;"}
55
+ padding="0"
56
+ extraStyles={`
57
+ min-width: 75px;
58
+ margin: 0px;
59
+ min-height: 0px;
60
+ `}
50
61
  textExtraStyles={`font-weight: ${FONT_WEIGHT_REGULAR}; font-size: 16px;`}
51
62
  />
52
63
  </Cluster>
@@ -55,11 +66,11 @@ const PaymentDetailsContent = ({
55
66
  </Box>
56
67
  </Cluster>
57
68
  ))}
58
- <Box padding="8px 0px 16px 0px">
69
+ <Box padding="16px 0px">
59
70
  <SolidDivider />
60
71
  </Box>
61
72
  <LabeledAmount
62
- fontWeight={FONT_WEIGHT_REGULAR}
73
+ extraStyles={`font-weight: ${FONT_WEIGHT_REGULAR};`}
63
74
  label="Amount paid"
64
75
  amount={displayCurrency(voidableAmountPaid)}
65
76
  />
@@ -68,20 +79,26 @@ const PaymentDetailsContent = ({
68
79
  {!hasVoidablePaymentsSection && !!lineItemElems.length && (
69
80
  <SolidDivider /> // avoids duplicate dividers -> case of voidable payment section, that acts as divider
70
81
  )}
71
- <Box padding="0.5rem 0">
72
- <LabeledAmount
73
- variant={themeValues.labeledAmountSubtotal}
74
- label="Subtotal"
75
- amount={displayCurrency(subtotal)}
76
- />
77
- {feeElems}
78
- </Box>
79
- <SolidDivider />
82
+ {subtotal && (
83
+ <>
84
+ <Box padding="0.5rem 0">
85
+ <LabeledAmount
86
+ variant={themeValues.labeledAmountSubtotal}
87
+ label="Subtotal"
88
+ amount={displayCurrency(subtotal)}
89
+ />
90
+ {feeElems}
91
+ </Box>
92
+ <SolidDivider />
93
+ </>
94
+ )}
80
95
  <LabeledAmount
81
96
  as="p"
82
97
  variant={themeValues.labeledAmountTotal}
83
98
  label={hasVoidablePaymentsSection ? "Remaining amount due" : "Total"}
84
- amount={displayCurrency(total)}
99
+ amount={displayCurrency(
100
+ typeof remainingBalance === "number" ? remainingBalance : total
101
+ )}
85
102
  extraStyles={variant === "small" && `font-weight: ${FONT_WEIGHT_BOLD};`}
86
103
  />
87
104
  </Stack>
@@ -135,7 +152,8 @@ const PaymentDetails = ({
135
152
  hasVoidablePaymentsSection = false,
136
153
  voidableTransactionDetails = [],
137
154
  partialVoidAction = noop,
138
- voidableAmountPaid = 0
155
+ voidableAmountPaid = 0,
156
+ remainingBalance = false
139
157
  // end partial void section
140
158
  }) => {
141
159
  const [isOpen, setIsOpen] = useState(initiallyOpen);
@@ -179,7 +197,8 @@ const PaymentDetails = ({
179
197
  hasVoidablePaymentsSection,
180
198
  voidableTransactionDetails,
181
199
  voidableAmountPaid,
182
- partialVoidAction
200
+ partialVoidAction,
201
+ remainingBalance
183
202
  }}
184
203
  />
185
204
  </Stack>
@@ -195,7 +214,8 @@ const PaymentDetails = ({
195
214
  hasVoidablePaymentsSection,
196
215
  voidableTransactionDetails,
197
216
  voidableAmountPaid,
198
- partialVoidAction
217
+ partialVoidAction,
218
+ remainingBalance
199
219
  }}
200
220
  />
201
221
  );
@@ -129,10 +129,10 @@ export const paymentDetails = () => (
129
129
 
130
130
  export const paymentDetailsWithPartialVoids = () => (
131
131
  <PaymentDetails
132
- subtotal={100}
132
+ subtotal={false}
133
133
  lineItems={lineItems2}
134
134
  fees={[]}
135
- total={100}
135
+ total={500}
136
136
  collapsibleOnMobile={boolean("collapsibleOnMobile", false, "props")}
137
137
  initiallyOpen={boolean("initiallyOpen", true, "props")}
138
138
  hideTitle={boolean("hideTitle", false, "props")}
@@ -147,6 +147,7 @@ export const paymentDetailsWithPartialVoids = () => (
147
147
  console.log(`Your function to void payment id: ${transaction.id}`);
148
148
  }}
149
149
  voidableAmountPaid={number("voidableAmountPaid", 400)}
150
+ remainingBalance={100}
150
151
  // end partial void section
151
152
  />
152
153
  );