@thecb/components 7.6.1-beta.1 → 7.7.0-beta.0

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.esm.js CHANGED
@@ -6310,14 +6310,6 @@ var throttle = function throttle(delay, fn) {
6310
6310
  return fn.apply(void 0, arguments);
6311
6311
  };
6312
6312
  };
6313
- var titleCaseWord = function titleCaseWord(word) {
6314
- return word.charAt(0).toUpperCase() + word.slice(1);
6315
- };
6316
- var titleCaseString = function titleCaseString(string) {
6317
- return string.split(" ").map(function (word, index, string) {
6318
- return index === 0 || index === string.length - 1 || word.length > 3 ? titleCaseWord(word.toLowerCase()) : word;
6319
- }).join(" ");
6320
- };
6321
6313
 
6322
6314
  var general = /*#__PURE__*/Object.freeze({
6323
6315
  __proto__: null,
@@ -6335,9 +6327,7 @@ var general = /*#__PURE__*/Object.freeze({
6335
6327
  inputPlaceholderTextStyle: inputPlaceholderTextStyle,
6336
6328
  inputDisabledStyle: inputDisabledStyle,
6337
6329
  MOBILE_WIDTH: MOBILE_WIDTH,
6338
- throttle: throttle,
6339
- titleCaseWord: titleCaseWord,
6340
- titleCaseString: titleCaseString
6330
+ throttle: throttle
6341
6331
  });
6342
6332
 
6343
6333
  var _excluded$1 = ["themeValues", "weight", "color", "textWrap", "extraStyles", "hoverStyles", "onClick", "onKeyPress", "as", "dataQa", "children", "variant"];
@@ -44638,10 +44628,6 @@ var NavMenuMobile = function NavMenuMobile(_ref) {
44638
44628
 
44639
44629
  var NavMenuMobile$1 = themeComponent(NavMenuMobile, "NavMenu", fallbackValues$E, "profile");
44640
44630
 
44641
- var ACH_METHOD = "BANK_ACCOUNT";
44642
- var CC_METHOD = "CREDIT_CARD";
44643
- var CASH_METHOD = "CASH";
44644
-
44645
44631
  var IconsModule = function IconsModule(_ref) {
44646
44632
  var icon = _ref.icon,
44647
44633
  iconDefault = _ref.iconDefault,
@@ -44721,27 +44707,13 @@ var AutopayModal = function AutopayModal(_ref) {
44721
44707
  isPaymentPlan = _ref.isPaymentPlan,
44722
44708
  nextAutopayDate = _ref.nextAutopayDate,
44723
44709
  dueDate = _ref.dueDate,
44724
- inactive = _ref.inactive,
44725
- description = _ref.description,
44726
- subDescription = _ref.subDescription,
44727
- allowedPaymentInstruments = _ref.allowedPaymentInstruments;
44728
-
44729
- var generateMethodNeededText = function generateMethodNeededText(planText, allowedPaymentInstruments) {
44730
- var allowsCard = allowedPaymentInstruments.includes(CC_METHOD);
44731
- var allowsACH = allowedPaymentInstruments.includes(ACH_METHOD);
44732
- var methodRequired = allowsCard && !allowsACH ? "debit or credit card payment method" : !allowsCard && allowsACH ? "checking account payment method" : "payment method";
44733
- return "To setup ".concat(planText, " you must have a saved ").concat(methodRequired, " and address in your profile. Do you want to save these now?");
44734
- };
44735
-
44736
- var plan = isPaymentPlan ? "your payment plan" : "autopay";
44737
- var shortPlan = isPaymentPlan ? "Payment Plan" : "Autopay";
44738
- var deactivateText = "deactivate ".concat(shortPlan, " for ").concat(description, ": ").concat(subDescription);
44739
- var activateText = "Set Up ".concat(shortPlan, " for ").concat(description, ": ").concat(subDescription);
44710
+ inactive = _ref.inactive;
44711
+ var planType = isPaymentPlan ? "Payment Plan" : "Autopay";
44740
44712
  var nextDate = dueDate || nextAutopayDate;
44741
44713
  var modalExtraProps = {
44742
- modalHeaderText: autoPayActive ? titleCaseString(deactivateText) : titleCaseString(activateText),
44743
- modalBodyText: autoPayActive ? "Are you sure you want to deactivate ".concat(plan, "? ").concat(!inactive && nextDate ? "Your next payment will be due on ".concat(nextDate, ".") : "") : generateMethodNeededText(plan, allowedPaymentInstruments),
44744
- continueButtonText: autoPayActive ? "Disable ".concat(shortPlan) : "Add to Profile",
44714
+ modalHeaderText: autoPayActive ? "Deactivate ".concat(planType) : "Set Up ".concat(planType),
44715
+ modalBodyText: autoPayActive ? "Are you sure you want to deactivate ".concat(isPaymentPlan ? "your payment plan" : "autopay", "? ").concat(!inactive && nextDate ? "Your next payment will be due on ".concat(nextDate, ".") : "") : "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?"),
44716
+ continueButtonText: autoPayActive ? "Disable ".concat(planType) : "Add to Profile",
44745
44717
  useDangerButton: autoPayActive,
44746
44718
  continueAction: autoPayActive ? function () {
44747
44719
  deactivatePaymentSchedule(isPaymentPlan ? paymentPlanSchedule : autoPaySchedule, isPaymentPlan);
@@ -44757,7 +44729,7 @@ var AutopayModal = function AutopayModal(_ref) {
44757
44729
  case "secondary":
44758
44730
  {
44759
44731
  return /*#__PURE__*/React.createElement(ButtonWithAction, {
44760
- text: autoPayActive ? "Turn off ".concat(shortPlan) : "Set Up ".concat(shortPlan),
44732
+ text: autoPayActive ? "Turn off ".concat(planType) : "Set Up ".concat(planType),
44761
44733
  variant: "secondary",
44762
44734
  action: function action() {
44763
44735
  toggleModal(true);
@@ -44770,7 +44742,7 @@ var AutopayModal = function AutopayModal(_ref) {
44770
44742
  case "tertiary":
44771
44743
  {
44772
44744
  return /*#__PURE__*/React.createElement(ButtonWithAction, {
44773
- text: autoPayActive ? "Manage ".concat(shortPlan) : "Set Up ".concat(shortPlan),
44745
+ text: autoPayActive ? "Manage ".concat(planType) : "Set Up ".concat(planType),
44774
44746
  variant: "tertiary",
44775
44747
  action: function action() {
44776
44748
  toggleModal(true);
@@ -44802,12 +44774,12 @@ var AutopayModal = function AutopayModal(_ref) {
44802
44774
  e.key === "Enter" && toggleModal(true);
44803
44775
  },
44804
44776
  tabIndex: "0",
44805
- dataQa: "".concat(shortPlan, " On"),
44777
+ dataQa: "".concat(planType, " On"),
44806
44778
  color: SEA_GREEN,
44807
44779
  weight: themeValues.fontWeight,
44808
44780
  hoverStyles: themeValues.modalLinkHoverFocus,
44809
44781
  extraStyles: "padding-left: 0.25rem;"
44810
- }, "".concat(shortPlan, " ").concat(nextAutopayDate))));
44782
+ }, "".concat(planType, " ").concat(nextAutopayDate))));
44811
44783
  }
44812
44784
  }
44813
44785
  };
@@ -44834,10 +44806,7 @@ var AmountModule = function AmountModule(_ref) {
44834
44806
  autoPaySchedule = _ref.autoPaySchedule,
44835
44807
  paymentPlanSchedule = _ref.paymentPlanSchedule,
44836
44808
  isPaymentPlan = _ref.isPaymentPlan,
44837
- nextAutopayDate = _ref.nextAutopayDate,
44838
- description = _ref.description,
44839
- subDescription = _ref.subDescription,
44840
- allowedPaymentInstruments = _ref.allowedPaymentInstruments;
44809
+ nextAutopayDate = _ref.nextAutopayDate;
44841
44810
 
44842
44811
  var _useState = useState(false),
44843
44812
  _useState2 = _slicedToArray(_useState, 2),
@@ -44866,10 +44835,7 @@ var AmountModule = function AmountModule(_ref) {
44866
44835
  paymentPlanSchedule: paymentPlanSchedule,
44867
44836
  isPaymentPlan: isPaymentPlan,
44868
44837
  nextAutopayDate: nextAutopayDate,
44869
- controlType: "link",
44870
- description: description,
44871
- subDescription: subDescription,
44872
- allowedPaymentInstruments: allowedPaymentInstruments
44838
+ controlType: "link"
44873
44839
  })));
44874
44840
  };
44875
44841
 
@@ -44888,10 +44854,7 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
44888
44854
  isPaymentPlan = _ref.isPaymentPlan,
44889
44855
  nextAutopayDate = _ref.nextAutopayDate,
44890
44856
  obligationAssocID = _ref.obligationAssocID,
44891
- dueDate = _ref.dueDate,
44892
- description = _ref.description,
44893
- subDescription = _ref.subDescription,
44894
- allowedPaymentInstruments = _ref.allowedPaymentInstruments;
44857
+ dueDate = _ref.dueDate;
44895
44858
  var planType = isPaymentPlan ? "Payment Plan" : "Autopay";
44896
44859
 
44897
44860
  var _useState = useState(false),
@@ -44947,10 +44910,7 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
44947
44910
  autoPaySchedule: autoPaySchedule,
44948
44911
  paymentPlanSchedule: paymentPlanSchedule,
44949
44912
  isPaymentPlan: isPaymentPlan,
44950
- nextAutopayDate: nextAutopayDate,
44951
- description: description,
44952
- subDescription: subDescription,
44953
- allowedPaymentInstruments: allowedPaymentInstruments
44913
+ nextAutopayDate: nextAutopayDate
44954
44914
  }))), /*#__PURE__*/React.createElement(Box, {
44955
44915
  padding: isMobile ? "16px" : "0"
44956
44916
  }, /*#__PURE__*/React.createElement(Cluster, {
@@ -44990,10 +44950,7 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
44990
44950
  paymentPlanSchedule: paymentPlanSchedule,
44991
44951
  isPaymentPlan: isPaymentPlan,
44992
44952
  nextAutopayDate: nextAutopayDate,
44993
- dueDate: dueDate,
44994
- description: description,
44995
- subDescription: subDescription,
44996
- allowedPaymentInstruments: allowedPaymentInstruments
44953
+ dueDate: dueDate
44997
44954
  })), !isMobile && /*#__PURE__*/React.createElement(Box, {
44998
44955
  padding: "0"
44999
44956
  }, /*#__PURE__*/React.createElement(ButtonWithAction, {
@@ -45083,10 +45040,7 @@ var InactiveControlsModule = function InactiveControlsModule(_ref) {
45083
45040
  dueDate = _ref.dueDate,
45084
45041
  agencyName = _ref.agencyName,
45085
45042
  configType = _ref.configType,
45086
- actions = _ref.actions,
45087
- description = _ref.description,
45088
- subDescription = _ref.subDescription,
45089
- allowedPaymentInstruments = _ref.allowedPaymentInstruments;
45043
+ actions = _ref.actions;
45090
45044
 
45091
45045
  var _useState = useState(false),
45092
45046
  _useState2 = _slicedToArray(_useState, 2),
@@ -45125,10 +45079,7 @@ var InactiveControlsModule = function InactiveControlsModule(_ref) {
45125
45079
  obligationAssocID: obligationAssocID,
45126
45080
  dueDate: dueDate,
45127
45081
  controlType: "secondary",
45128
- inactive: true,
45129
- description: description,
45130
- subDescription: subDescription,
45131
- allowedPaymentInstruments: allowedPaymentInstruments
45082
+ inactive: true
45132
45083
  })), /*#__PURE__*/React.createElement(Box, {
45133
45084
  padding: "0",
45134
45085
  extraStyles: "flex-grow: 1;"
@@ -45170,7 +45121,7 @@ var InactiveTitleModule = function InactiveTitleModule(_ref) {
45170
45121
  };
45171
45122
 
45172
45123
  var Obligation = function Obligation(_ref) {
45173
- var _obligations$, _firstObligation$cust;
45124
+ var _firstObligation$cust, _firstObligation$desc, _firstObligation$subD;
45174
45125
 
45175
45126
  var config = _ref.config,
45176
45127
  obligations = _ref.obligations,
@@ -45205,13 +45156,7 @@ var Obligation = function Obligation(_ref) {
45205
45156
  The top level desc/subdesc for all obligations in a collection is the same
45206
45157
  (Collection accounts look different in the Account Details page)
45207
45158
  */
45208
- var firstObligation = (_obligations$ = obligations === null || obligations === void 0 ? void 0 : obligations[0]) !== null && _obligations$ !== void 0 ? _obligations$ : {};
45209
- var _firstObligation$allo = firstObligation.allowedPaymentInstruments,
45210
- allowedPaymentInstruments = _firstObligation$allo === void 0 ? [CASH_METHOD, CC_METHOD, ACH_METHOD] : _firstObligation$allo,
45211
- _firstObligation$desc = firstObligation.description,
45212
- description = _firstObligation$desc === void 0 ? "Account" : _firstObligation$desc,
45213
- _firstObligation$subD = firstObligation.subDescription,
45214
- subDescription = _firstObligation$subD === void 0 ? obligationAssocID : _firstObligation$subD;
45159
+ var firstObligation = obligations[0];
45215
45160
  var customAttributes = (_firstObligation$cust = firstObligation === null || firstObligation === void 0 ? void 0 : firstObligation.customAttributes) !== null && _firstObligation$cust !== void 0 ? _firstObligation$cust : {};
45216
45161
  var boxShadowValue = "0px 2px 4px rgba(41, 42, 51, 0.1), 0px 1px 1px 2px rgba(41, 42, 51, 0.1);";
45217
45162
  var activeObligation = /*#__PURE__*/React.createElement(Box, {
@@ -45219,7 +45164,7 @@ var Obligation = function Obligation(_ref) {
45219
45164
  borderRadius: "4px",
45220
45165
  boxShadow: boxShadowValue,
45221
45166
  as: "section",
45222
- "aria-label": "".concat(description, " - ").concat(subDescription),
45167
+ "aria-label": "".concat((_firstObligation$desc = firstObligation === null || firstObligation === void 0 ? void 0 : firstObligation.description) !== null && _firstObligation$desc !== void 0 ? _firstObligation$desc : "account", " ").concat((_firstObligation$subD = firstObligation === null || firstObligation === void 0 ? void 0 : firstObligation.subDescription) !== null && _firstObligation$subD !== void 0 ? _firstObligation$subD : obligationAssocID),
45223
45168
  border: "1px solid ".concat(GRECIAN_GREY),
45224
45169
  borderWidthOverride: "1px 0 0 0"
45225
45170
  }, /*#__PURE__*/React.createElement(Box, {
@@ -45248,8 +45193,8 @@ var Obligation = function Obligation(_ref) {
45248
45193
  iconValue: config.iconValue,
45249
45194
  customAttributes: customAttributes
45250
45195
  }), /*#__PURE__*/React.createElement(TitleModule, {
45251
- title: description,
45252
- subtitle: subDescription,
45196
+ title: firstObligation === null || firstObligation === void 0 ? void 0 : firstObligation.description,
45197
+ subtitle: firstObligation === null || firstObligation === void 0 ? void 0 : firstObligation.subDescription,
45253
45198
  titleColor: BRIGHT_GREY,
45254
45199
  isMobile: isMobile
45255
45200
  }))), !isMobile && /*#__PURE__*/React.createElement(AmountModule, {
@@ -45263,10 +45208,7 @@ var Obligation = function Obligation(_ref) {
45263
45208
  autoPaySchedule: autoPaySchedule,
45264
45209
  paymentPlanSchedule: paymentPlanSchedule,
45265
45210
  isPaymentPlan: isPaymentPlan,
45266
- nextAutopayDate: nextAutopayDate,
45267
- description: description,
45268
- subDescription: subDescription,
45269
- allowedPaymentInstruments: allowedPaymentInstruments
45211
+ nextAutopayDate: nextAutopayDate
45270
45212
  }))), !isMobile && /*#__PURE__*/React.createElement(PaymentDetailsActions, {
45271
45213
  obligations: obligations,
45272
45214
  autoPayEnabled: autoPayEnabled,
@@ -45281,10 +45223,7 @@ var Obligation = function Obligation(_ref) {
45281
45223
  isMobile: isMobile,
45282
45224
  isPaymentPlan: isPaymentPlan,
45283
45225
  nextAutopayDate: nextAutopayDate,
45284
- obligationAssocID: obligationAssocID,
45285
- description: description,
45286
- subDescription: subDescription,
45287
- allowedPaymentInstruments: allowedPaymentInstruments
45226
+ obligationAssocID: obligationAssocID
45288
45227
  }))), isMobile && /*#__PURE__*/React.createElement(PaymentDetailsActions, {
45289
45228
  obligations: obligations,
45290
45229
  autoPayEnabled: autoPayEnabled,
@@ -45299,10 +45238,7 @@ var Obligation = function Obligation(_ref) {
45299
45238
  isMobile: isMobile,
45300
45239
  isPaymentPlan: isPaymentPlan,
45301
45240
  nextAutopayDate: nextAutopayDate,
45302
- obligationAssocID: obligationAssocID,
45303
- description: description,
45304
- subDescription: subDescription,
45305
- allowedPaymentInstruments: allowedPaymentInstruments
45241
+ obligationAssocID: obligationAssocID
45306
45242
  }));
45307
45243
  var inactiveObligation = /*#__PURE__*/React.createElement(Box, {
45308
45244
  padding: "0",
@@ -45355,10 +45291,7 @@ var Obligation = function Obligation(_ref) {
45355
45291
  obligationAssocID: obligationAssocID,
45356
45292
  dueDate: dueDate,
45357
45293
  agencyName: agencyName,
45358
- configType: config.type,
45359
- description: description,
45360
- subDescription: subDescription,
45361
- allowedPaymentInstruments: allowedPaymentInstruments
45294
+ configType: config.type
45362
45295
  }))), isMobile && /*#__PURE__*/React.createElement(InactiveControlsModule, {
45363
45296
  obligations: obligations,
45364
45297
  autoPayEnabled: autoPayEnabled,
@@ -45372,10 +45305,7 @@ var Obligation = function Obligation(_ref) {
45372
45305
  obligationAssocID: obligationAssocID,
45373
45306
  dueDate: dueDate,
45374
45307
  agencyName: agencyName,
45375
- configType: config.type,
45376
- description: description,
45377
- subDescription: subDescription,
45378
- allowedPaymentInstruments: allowedPaymentInstruments
45308
+ configType: config.type
45379
45309
  }))));
45380
45310
  return inactive ? inactiveObligation : activeObligation;
45381
45311
  };
@@ -46600,7 +46530,7 @@ var RadioGroup = function RadioGroup(_ref) {
46600
46530
  groupName: groupName,
46601
46531
  setValue: setValue,
46602
46532
  handleChange: handleChange,
46603
- "aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors
46533
+ "aria-invalid": field.dirty && field.hasErrors || field.hasErrors
46604
46534
  }));
46605
46535
  })));
46606
46536
  };