@thecb/components 4.0.0 → 4.0.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 CHANGED
@@ -14266,11 +14266,11 @@ var Alert = function Alert(_ref) {
14266
14266
  }, /*#__PURE__*/React__default.createElement(Icon, null)))), /*#__PURE__*/React__default.createElement(Box, {
14267
14267
  padding: "0"
14268
14268
  }, /*#__PURE__*/React__default.createElement(Sidebar, {
14269
- onRight: true,
14269
+ sidebarOnRight: true,
14270
14270
  width: "24px",
14271
14271
  childGap: "0rem"
14272
14272
  }, /*#__PURE__*/React__default.createElement(Box, {
14273
- padding: "".concat(padding, " 1rem")
14273
+ padding: maxContentWidth ? "".concat(padding, " 1rem") : "1rem"
14274
14274
  }, /*#__PURE__*/React__default.createElement(Cluster, {
14275
14275
  justify: "flex-start",
14276
14276
  align: "center"
@@ -18548,7 +18548,8 @@ var FormattedInputField = styled__default(function (_ref7) {
18548
18548
  var FormInput = function FormInput(_ref13) {
18549
18549
  var _ref13$type = _ref13.type,
18550
18550
  type = _ref13$type === void 0 ? "text" : _ref13$type,
18551
- labelTextWhenNoError = _ref13.labelTextWhenNoError,
18551
+ _ref13$labelTextWhenN = _ref13.labelTextWhenNoError,
18552
+ labelTextWhenNoError = _ref13$labelTextWhenN === void 0 ? "" : _ref13$labelTextWhenN,
18552
18553
  errorMessages = _ref13.errorMessages,
18553
18554
  _ref13$isNum = _ref13.isNum,
18554
18555
  isNum = _ref13$isNum === void 0 ? false : _ref13$isNum,
@@ -36077,20 +36078,23 @@ var fallbackValues$t = {
36077
36078
  var AutopayModal = function AutopayModal(_ref) {
36078
36079
  var autoPayActive = _ref.autoPayActive,
36079
36080
  autoPaySchedule = _ref.autoPaySchedule,
36081
+ paymentPlanSchedule = _ref.paymentPlanSchedule,
36080
36082
  toggleModal = _ref.toggleModal,
36081
36083
  modalOpen = _ref.modalOpen,
36082
36084
  deactivatePaymentSchedule = _ref.deactivatePaymentSchedule,
36083
36085
  navigateToSettings = _ref.navigateToSettings,
36084
36086
  buttonLinkType = _ref.buttonLinkType,
36085
36087
  isMobile = _ref.isMobile,
36086
- themeValues = _ref.themeValues;
36088
+ themeValues = _ref.themeValues,
36089
+ isPaymentPlan = _ref.isPaymentPlan;
36090
+ var planType = isPaymentPlan ? "Payment Plan" : "Autopay";
36087
36091
  var modalExtraProps = {
36088
- modalHeaderText: autoPayActive ? "Deactivate Autopay" : "Set Up Autopay",
36089
- modalBodyText: autoPayActive ? "Are you sure you want to deactivate autopay? You will need to manually make your next payment." : "To set up autopay you must save a payment method and address in your profile. Do you want to save these now?",
36090
- continueButtonText: autoPayActive ? "Disable Autopay" : "Add to Profile",
36092
+ modalHeaderText: autoPayActive ? "Deactivate ".concat(planType) : "Set Up ".concat(planType),
36093
+ modalBodyText: autoPayActive ? "Are you sure you want to deactivate ".concat(isPaymentPlan ? "your payment plan" : "autopay", "? You will need to manually make your next payment.") : "To set up ".concat(isPaymentPlan ? "a payment plan" : "autopay", " you must save a payment method and address in your profile. Do you want to save these now?"),
36094
+ continueButtonText: autoPayActive ? "Disable ".concat(planType) : "Add to Profile",
36091
36095
  useDangerButton: autoPayActive,
36092
36096
  continueAction: autoPayActive ? function () {
36093
- deactivatePaymentSchedule(autoPaySchedule);
36097
+ deactivatePaymentSchedule(isPaymentPlan ? paymentPlanSchedule : autoPaySchedule, isPaymentPlan);
36094
36098
  toggleModal(false);
36095
36099
  } : navigateToSettings
36096
36100
  };
@@ -36100,7 +36104,7 @@ var AutopayModal = function AutopayModal(_ref) {
36100
36104
  return /*#__PURE__*/React__default.createElement(Modal$1, _extends({
36101
36105
  ModalLink: function ModalLink() {
36102
36106
  return buttonLinkType ? /*#__PURE__*/React__default.createElement(ButtonWithAction, {
36103
- text: autoPayActive ? "Manage Autopay" : "Set Up Autopay",
36107
+ text: autoPayActive ? "Manage ".concat(planType) : "Set Up ".concat(planType),
36104
36108
  variant: "tertiary",
36105
36109
  action: function action() {
36106
36110
  toggleModal(true);
@@ -36119,7 +36123,7 @@ var AutopayModal = function AutopayModal(_ref) {
36119
36123
  justify: isMobile ? "flex-start" : "flex-end",
36120
36124
  align: "center"
36121
36125
  }, /*#__PURE__*/React__default.createElement(AutopayOnIcon$1, null), /*#__PURE__*/React__default.createElement(ButtonWithAction, {
36122
- text: "Autopay On",
36126
+ text: "".concat(planType, " On"),
36123
36127
  variant: "smallGhost",
36124
36128
  dataQa: "Autopay On",
36125
36129
  textExtraStyles: "font-size: 0.875rem; ",
@@ -36144,7 +36148,9 @@ var AmountModule = function AmountModule(_ref) {
36144
36148
  isMobile = _ref.isMobile,
36145
36149
  deactivatePaymentSchedule = _ref.deactivatePaymentSchedule,
36146
36150
  navigateToSettings = _ref.navigateToSettings,
36147
- autoPaySchedule = _ref.autoPaySchedule;
36151
+ autoPaySchedule = _ref.autoPaySchedule,
36152
+ paymentPlanSchedule = _ref.paymentPlanSchedule,
36153
+ isPaymentPlan = _ref.isPaymentPlan;
36148
36154
 
36149
36155
  var _useState = React.useState(false),
36150
36156
  _useState2 = _slicedToArray(_useState, 2),
@@ -36169,7 +36175,9 @@ var AmountModule = function AmountModule(_ref) {
36169
36175
  modalOpen: modalOpen,
36170
36176
  navigateToSettings: navigateToSettings,
36171
36177
  deactivatePaymentSchedule: deactivatePaymentSchedule,
36172
- isMobile: isMobile
36178
+ isMobile: isMobile,
36179
+ paymentPlanSchedule: paymentPlanSchedule,
36180
+ isPaymentPlan: isPaymentPlan
36173
36181
  })));
36174
36182
  };
36175
36183
 
@@ -36183,7 +36191,10 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
36183
36191
  handleAutopayAction = _ref.handleAutopayAction,
36184
36192
  deactivatePaymentSchedule = _ref.deactivatePaymentSchedule,
36185
36193
  navigateToSettings = _ref.navigateToSettings,
36186
- autoPaySchedule = _ref.autoPaySchedule;
36194
+ autoPaySchedule = _ref.autoPaySchedule,
36195
+ paymentPlanSchedule = _ref.paymentPlanSchedule,
36196
+ isPaymentPlan = _ref.isPaymentPlan;
36197
+ var planType = isPaymentPlan ? "Payment Plan" : "Autopay";
36187
36198
 
36188
36199
  var _useState = React.useState(false),
36189
36200
  _useState2 = _slicedToArray(_useState, 2),
@@ -36235,7 +36246,9 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
36235
36246
  isMobile: isMobile,
36236
36247
  deactivatePaymentSchedule: deactivatePaymentSchedule,
36237
36248
  navigateToSettings: navigateToSettings,
36238
- autoPaySchedule: autoPaySchedule
36249
+ autoPaySchedule: autoPaySchedule,
36250
+ paymentPlanSchedule: paymentPlanSchedule,
36251
+ isPaymentPlan: isPaymentPlan
36239
36252
  }))), /*#__PURE__*/React__default.createElement(Box, {
36240
36253
  padding: isMobile ? "16px" : "0"
36241
36254
  }, /*#__PURE__*/React__default.createElement(Cluster, {
@@ -36256,7 +36269,7 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
36256
36269
  extraStyles: isMobile && "flex-grow: 1;"
36257
36270
  }, autoPayAvailable && !autoPayEnabled ? /*#__PURE__*/React__default.createElement(ButtonWithAction, {
36258
36271
  variant: "tertiary",
36259
- text: "Set Up Autopay",
36272
+ text: "Set Up ".concat(planType),
36260
36273
  action: function action() {
36261
36274
  setDetailedObligation(obligations, config);
36262
36275
  handleAutopayAction();
@@ -36271,7 +36284,9 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
36271
36284
  navigateToSettings: navigateToSettings,
36272
36285
  deactivatePaymentSchedule: deactivatePaymentSchedule,
36273
36286
  buttonLinkType: true,
36274
- isMobile: isMobile
36287
+ isMobile: isMobile,
36288
+ paymentPlanSchedule: paymentPlanSchedule,
36289
+ isPaymentPlan: isPaymentPlan
36275
36290
  })), !isMobile && /*#__PURE__*/React__default.createElement(Box, {
36276
36291
  padding: isMobile ? "0 0 0 8px" : "8px",
36277
36292
  extraStyles: isMobile && "flex-grow: 1;"
@@ -36308,8 +36323,10 @@ var Obligation = function Obligation(_ref) {
36308
36323
  handleAutopayAction = _ref.handleAutopayAction,
36309
36324
  deactivatePaymentSchedule = _ref.deactivatePaymentSchedule,
36310
36325
  autoPaySchedule = _ref.autoPaySchedule,
36326
+ paymentPlanSchedule = _ref.paymentPlanSchedule,
36311
36327
  navigateToSettings = _ref.navigateToSettings,
36312
- isMobile = _ref.isMobile;
36328
+ isMobile = _ref.isMobile,
36329
+ isPaymentPlan = _ref.isPaymentPlan;
36313
36330
  var obligation = obligations[0];
36314
36331
  var customAttributes = obligation.customAttributes;
36315
36332
  return /*#__PURE__*/React__default.createElement(Box, {
@@ -36353,7 +36370,9 @@ var Obligation = function Obligation(_ref) {
36353
36370
  isMobile: isMobile,
36354
36371
  deactivatePaymentSchedule: deactivatePaymentSchedule,
36355
36372
  navigateToSettings: navigateToSettings,
36356
- autoPaySchedule: autoPaySchedule
36373
+ autoPaySchedule: autoPaySchedule,
36374
+ paymentPlanSchedule: paymentPlanSchedule,
36375
+ isPaymentPlan: isPaymentPlan
36357
36376
  }))), !isMobile && /*#__PURE__*/React__default.createElement(PaymentDetailsActions, {
36358
36377
  obligations: obligations,
36359
36378
  autoPayEnabled: autoPayEnabled,
@@ -36361,10 +36380,12 @@ var Obligation = function Obligation(_ref) {
36361
36380
  handleAutopayAction: handleAutopayAction,
36362
36381
  deactivatePaymentSchedule: deactivatePaymentSchedule,
36363
36382
  autoPaySchedule: autoPaySchedule,
36383
+ paymentPlanSchedule: paymentPlanSchedule,
36364
36384
  navigateToSettings: navigateToSettings,
36365
36385
  config: config,
36366
36386
  actions: actions,
36367
- isMobile: isMobile
36387
+ isMobile: isMobile,
36388
+ isPaymentPlan: isPaymentPlan
36368
36389
  }))), isMobile && /*#__PURE__*/React__default.createElement(PaymentDetailsActions, {
36369
36390
  obligations: obligations,
36370
36391
  autoPayEnabled: autoPayEnabled,
@@ -36372,10 +36393,12 @@ var Obligation = function Obligation(_ref) {
36372
36393
  handleAutopayAction: handleAutopayAction,
36373
36394
  deactivatePaymentSchedule: deactivatePaymentSchedule,
36374
36395
  autoPaySchedule: autoPaySchedule,
36396
+ paymentPlanSchedule: paymentPlanSchedule,
36375
36397
  navigateToSettings: navigateToSettings,
36376
36398
  config: config,
36377
36399
  actions: actions,
36378
- isMobile: isMobile
36400
+ isMobile: isMobile,
36401
+ isPaymentPlan: isPaymentPlan
36379
36402
  }));
36380
36403
  };
36381
36404
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "4.0.0",
3
+ "version": "4.0.3-beta.1",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -31,8 +31,8 @@ const Alert = ({
31
31
  </Cover>
32
32
  </Box>
33
33
  <Box padding="0">
34
- <Sidebar onRight width="24px" childGap="0rem">
35
- <Box padding={`${padding} 1rem`}>
34
+ <Sidebar sidebarOnRight width="24px" childGap="0rem">
35
+ <Box padding={maxContentWidth ? `${padding} 1rem` : "1rem"}>
36
36
  <Cluster justify="flex-start" align="center">
37
37
  {textOverride ? (
38
38
  textOverride
@@ -82,7 +82,7 @@ const FormattedInputField = styled(({ showErrors, themeValues, ...props }) => (
82
82
 
83
83
  const FormInput = ({
84
84
  type = "text",
85
- labelTextWhenNoError,
85
+ labelTextWhenNoError = "",
86
86
  errorMessages,
87
87
  isNum = false,
88
88
  helperModal = false,
@@ -17,8 +17,10 @@ const Obligation = ({
17
17
  handleAutopayAction,
18
18
  deactivatePaymentSchedule,
19
19
  autoPaySchedule,
20
+ paymentPlanSchedule,
20
21
  navigateToSettings,
21
- isMobile
22
+ isMobile,
23
+ isPaymentPlan
22
24
  }) => {
23
25
  const obligation = obligations[0];
24
26
  const { customAttributes } = obligation;
@@ -67,6 +69,8 @@ const Obligation = ({
67
69
  deactivatePaymentSchedule={deactivatePaymentSchedule}
68
70
  navigateToSettings={navigateToSettings}
69
71
  autoPaySchedule={autoPaySchedule}
72
+ paymentPlanSchedule={paymentPlanSchedule}
73
+ isPaymentPlan={isPaymentPlan}
70
74
  />
71
75
  )}
72
76
  </Cluster>
@@ -79,10 +83,12 @@ const Obligation = ({
79
83
  handleAutopayAction={handleAutopayAction}
80
84
  deactivatePaymentSchedule={deactivatePaymentSchedule}
81
85
  autoPaySchedule={autoPaySchedule}
86
+ paymentPlanSchedule={paymentPlanSchedule}
82
87
  navigateToSettings={navigateToSettings}
83
88
  config={config}
84
89
  actions={actions}
85
90
  isMobile={isMobile}
91
+ isPaymentPlan={isPaymentPlan}
86
92
  />
87
93
  )}
88
94
  </Stack>
@@ -95,10 +101,12 @@ const Obligation = ({
95
101
  handleAutopayAction={handleAutopayAction}
96
102
  deactivatePaymentSchedule={deactivatePaymentSchedule}
97
103
  autoPaySchedule={autoPaySchedule}
104
+ paymentPlanSchedule={paymentPlanSchedule}
98
105
  navigateToSettings={navigateToSettings}
99
106
  config={config}
100
107
  actions={actions}
101
108
  isMobile={isMobile}
109
+ isPaymentPlan={isPaymentPlan}
102
110
  />
103
111
  )}
104
112
  </Box>
@@ -12,7 +12,9 @@ const AmountModule = ({
12
12
  isMobile,
13
13
  deactivatePaymentSchedule,
14
14
  navigateToSettings,
15
- autoPaySchedule
15
+ autoPaySchedule,
16
+ paymentPlanSchedule,
17
+ isPaymentPlan
16
18
  }) => {
17
19
  const [modalOpen, toggleModal] = useState(false);
18
20
  return (
@@ -38,6 +40,8 @@ const AmountModule = ({
38
40
  navigateToSettings={navigateToSettings}
39
41
  deactivatePaymentSchedule={deactivatePaymentSchedule}
40
42
  isMobile={isMobile}
43
+ paymentPlanSchedule={paymentPlanSchedule}
44
+ isPaymentPlan={isPaymentPlan}
41
45
  />
42
46
  )}
43
47
  </Stack>
@@ -9,24 +9,38 @@ import { themeComponent } from "../../../../util/themeUtils";
9
9
  const AutopayModal = ({
10
10
  autoPayActive,
11
11
  autoPaySchedule,
12
+ paymentPlanSchedule,
12
13
  toggleModal,
13
14
  modalOpen,
14
15
  deactivatePaymentSchedule,
15
16
  navigateToSettings,
16
17
  buttonLinkType,
17
18
  isMobile,
18
- themeValues
19
+ themeValues,
20
+ isPaymentPlan
19
21
  }) => {
22
+ const planType = isPaymentPlan ? "Payment Plan" : "Autopay";
20
23
  const modalExtraProps = {
21
- modalHeaderText: autoPayActive ? "Deactivate Autopay" : "Set Up Autopay",
24
+ modalHeaderText: autoPayActive
25
+ ? `Deactivate ${planType}`
26
+ : `Set Up ${planType}`,
22
27
  modalBodyText: autoPayActive
23
- ? "Are you sure you want to deactivate autopay? You will need to manually make your next payment."
24
- : "To set up autopay you must save a payment method and address in your profile. Do you want to save these now?",
25
- continueButtonText: autoPayActive ? "Disable Autopay" : "Add to Profile",
28
+ ? `Are you sure you want to deactivate ${
29
+ isPaymentPlan ? "your payment plan" : "autopay"
30
+ }? You will need to manually make your next payment.`
31
+ : `To set up ${
32
+ isPaymentPlan ? "a payment plan" : "autopay"
33
+ } you must save a payment method and address in your profile. Do you want to save these now?`,
34
+ continueButtonText: autoPayActive
35
+ ? `Disable ${planType}`
36
+ : "Add to Profile",
26
37
  useDangerButton: autoPayActive,
27
38
  continueAction: autoPayActive
28
39
  ? () => {
29
- deactivatePaymentSchedule(autoPaySchedule);
40
+ deactivatePaymentSchedule(
41
+ isPaymentPlan ? paymentPlanSchedule : autoPaySchedule,
42
+ isPaymentPlan
43
+ );
30
44
  toggleModal(false);
31
45
  }
32
46
  : navigateToSettings
@@ -50,7 +64,7 @@ const AutopayModal = ({
50
64
  ModalLink={() =>
51
65
  buttonLinkType ? (
52
66
  <ButtonWithAction
53
- text={autoPayActive ? "Manage Autopay" : "Set Up Autopay"}
67
+ text={autoPayActive ? `Manage ${planType}` : `Set Up ${planType}`}
54
68
  variant="tertiary"
55
69
  action={() => {
56
70
  toggleModal(true);
@@ -74,7 +88,7 @@ const AutopayModal = ({
74
88
  >
75
89
  <AutopayOnIcon />
76
90
  <ButtonWithAction
77
- text="Autopay On"
91
+ text={`${planType} On`}
78
92
  variant="smallGhost"
79
93
  dataQa="Autopay On"
80
94
  textExtraStyles={`font-size: 0.875rem; `}
@@ -15,8 +15,11 @@ const PaymentDetailsActions = ({
15
15
  handleAutopayAction,
16
16
  deactivatePaymentSchedule,
17
17
  navigateToSettings,
18
- autoPaySchedule
18
+ autoPaySchedule,
19
+ paymentPlanSchedule,
20
+ isPaymentPlan
19
21
  }) => {
22
+ const planType = isPaymentPlan ? "Payment Plan" : "Autopay";
20
23
  const [isLoading, setIsLoading] = useState(false);
21
24
  const [modalOpen, toggleModal] = useState(false);
22
25
  const { obligationSlug } = config;
@@ -64,6 +67,8 @@ const PaymentDetailsActions = ({
64
67
  deactivatePaymentSchedule={deactivatePaymentSchedule}
65
68
  navigateToSettings={navigateToSettings}
66
69
  autoPaySchedule={autoPaySchedule}
70
+ paymentPlanSchedule={paymentPlanSchedule}
71
+ isPaymentPlan={isPaymentPlan}
67
72
  />
68
73
  </Cluster>
69
74
  </Box>
@@ -97,7 +102,7 @@ const PaymentDetailsActions = ({
97
102
  {autoPayAvailable && !autoPayEnabled ? (
98
103
  <ButtonWithAction
99
104
  variant="tertiary"
100
- text="Set Up Autopay"
105
+ text={`Set Up ${planType}`}
101
106
  action={() => {
102
107
  setDetailedObligation(obligations, config);
103
108
  handleAutopayAction();
@@ -115,6 +120,8 @@ const PaymentDetailsActions = ({
115
120
  deactivatePaymentSchedule={deactivatePaymentSchedule}
116
121
  buttonLinkType
117
122
  isMobile={isMobile}
123
+ paymentPlanSchedule={paymentPlanSchedule}
124
+ isPaymentPlan={isPaymentPlan}
118
125
  />
119
126
  )}
120
127
  </Box>