@thecb/components 11.1.3 → 11.1.4-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
@@ -46941,7 +46941,9 @@ var AmountModule = function AmountModule(_ref) {
46941
46941
  subDescription = _ref.subDescription,
46942
46942
  allowedPaymentInstruments = _ref.allowedPaymentInstruments,
46943
46943
  _ref$disableActions = _ref.disableActions,
46944
- disableActions = _ref$disableActions === void 0 ? false : _ref$disableActions;
46944
+ disableActions = _ref$disableActions === void 0 ? false : _ref$disableActions,
46945
+ _ref$isLoading = _ref.isLoading,
46946
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
46945
46947
  var _useState = useState(false),
46946
46948
  _useState2 = _slicedToArray(_useState, 2),
46947
46949
  modalOpen = _useState2[0],
@@ -46954,7 +46956,25 @@ var AmountModule = function AmountModule(_ref) {
46954
46956
  variant: "pS",
46955
46957
  weight: FONT_WEIGHT_SEMIBOLD,
46956
46958
  textAlign: "left"
46957
- }, "Amount Due"), /*#__PURE__*/React.createElement(AmountCallout$1, {
46959
+ }, "Amount Due"), isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LoadingLine, {
46960
+ minWidth: "70",
46961
+ maxWidth: "80",
46962
+ height: "26px",
46963
+ margin: isMobile ? "0" : "0 0 0 auto",
46964
+ foregroundColor: GRECIAN_GREY,
46965
+ style: {
46966
+ borderRadius: "0.125rem"
46967
+ }
46968
+ }), /*#__PURE__*/React.createElement(LoadingLine, {
46969
+ minWidth: "134",
46970
+ maxWidth: "178",
46971
+ height: "21px",
46972
+ margin: isMobile ? "0.25rem 0 0 0" : "0.25rem 0 0 auto",
46973
+ foregroundColor: GRECIAN_GREY,
46974
+ style: {
46975
+ borderRadius: "0.125rem"
46976
+ }
46977
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AmountCallout$1, {
46958
46978
  amount: displayCurrency(totalAmountDue),
46959
46979
  textAlign: isMobile ? "left" : "right"
46960
46980
  }), autoPayEnabled && /*#__PURE__*/React.createElement(AutopayModalModule, {
@@ -46982,7 +47002,7 @@ var AmountModule = function AmountModule(_ref) {
46982
47002
  onKeyPress: disableActions ? noop$1 : function (e) {
46983
47003
  e.key === "Enter" && toggleModal(true);
46984
47004
  }
46985
- })));
47005
+ }))));
46986
47006
  };
46987
47007
 
46988
47008
  var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
@@ -47008,7 +47028,8 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
47008
47028
  disableActions = _ref$disableActions === void 0 ? false : _ref$disableActions,
47009
47029
  cartEnabled = _ref.cartEnabled,
47010
47030
  cartConfig = _ref.cartConfig,
47011
- isInCart = _ref.isInCart;
47031
+ isInCart = _ref.isInCart,
47032
+ isContentLoading = _ref.isContentLoading;
47012
47033
  var planType = isPaymentPlan ? "Payment Plan" : "Autopay";
47013
47034
  var _useState = useState(false),
47014
47035
  _useState2 = _slicedToArray(_useState, 2),
@@ -47085,7 +47106,8 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
47085
47106
  description: description,
47086
47107
  subDescription: subDescription,
47087
47108
  allowedPaymentInstruments: allowedPaymentInstruments,
47088
- isInCustomerManagement: disableActions
47109
+ isInCustomerManagement: disableActions,
47110
+ isLoading: isContentLoading
47089
47111
  }))), /*#__PURE__*/React.createElement(Box, {
47090
47112
  padding: isMobile ? "16px" : "0"
47091
47113
  }, /*#__PURE__*/React.createElement(Cluster, {
@@ -47351,7 +47373,9 @@ var Obligation = function Obligation(_ref) {
47351
47373
  _ref$multiCartParams = _ref.multiCartParams,
47352
47374
  multiCartParams = _ref$multiCartParams === void 0 ? undefined : _ref$multiCartParams,
47353
47375
  _ref$isInCart = _ref.isInCart,
47354
- isInCart = _ref$isInCart === void 0 ? false : _ref$isInCart;
47376
+ isInCart = _ref$isInCart === void 0 ? false : _ref$isInCart,
47377
+ _ref$isLoading = _ref.isLoading,
47378
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
47355
47379
  /*
47356
47380
  The value of obligations is always an array. It can contain:
47357
47381
  - A single obligation
@@ -47369,6 +47393,90 @@ var Obligation = function Obligation(_ref) {
47369
47393
  subDescription = _firstObligation$subD === void 0 ? obligationAssocID : _firstObligation$subD;
47370
47394
  var customAttributes = (_firstObligation$cust = firstObligation === null || firstObligation === void 0 ? void 0 : firstObligation.customAttributes) !== null && _firstObligation$cust !== void 0 ? _firstObligation$cust : {};
47371
47395
  var boxShadowValue = "0px 2px 4px rgba(41, 42, 51, 0.1), 0px 1px 1px 2px rgba(41, 42, 51, 0.1);";
47396
+ var loadingObligation = /*#__PURE__*/React.createElement(Box, {
47397
+ padding: "0",
47398
+ borderRadius: "4px",
47399
+ boxShadow: boxShadowValue,
47400
+ as: "section",
47401
+ "aria-label": "".concat(description, " - ").concat(subDescription),
47402
+ border: "1px solid ".concat(GRECIAN_GREY),
47403
+ borderWidthOverride: "1px 0 0 0"
47404
+ }, /*#__PURE__*/React.createElement(Box, {
47405
+ background: WHITE,
47406
+ padding: isMobile ? "16px" : "24px 16px"
47407
+ }, /*#__PURE__*/React.createElement(Stack, {
47408
+ childGap: "24px"
47409
+ }, /*#__PURE__*/React.createElement(Box, {
47410
+ key: "".concat(firstObligation === null || firstObligation === void 0 ? void 0 : firstObligation.id, "-top"),
47411
+ padding: "0 8px",
47412
+ minWidth: "100%"
47413
+ }, /*#__PURE__*/React.createElement(Cluster, {
47414
+ justify: "space-between",
47415
+ align: "center",
47416
+ childGap: "4px",
47417
+ nowrap: true
47418
+ }, /*#__PURE__*/React.createElement(Box, {
47419
+ padding: "0"
47420
+ }, /*#__PURE__*/React.createElement(Cluster, {
47421
+ justify: "flex-start",
47422
+ align: "center"
47423
+ }, !isMobile && /*#__PURE__*/React.createElement(IconsModule, {
47424
+ icon: config.icon,
47425
+ iconDefault: config.iconDefault,
47426
+ configIconMap: config.iconMap,
47427
+ iconValue: config.iconValue,
47428
+ customAttributes: customAttributes,
47429
+ iconColor: themeValues.iconColor
47430
+ }), /*#__PURE__*/React.createElement(TitleModule, {
47431
+ title: description,
47432
+ subtitle: subDescription,
47433
+ titleColor: BRIGHT_GREY,
47434
+ isMobile: isMobile
47435
+ }))), !isMobile && /*#__PURE__*/React.createElement(AmountModule, {
47436
+ isMobile: isMobile,
47437
+ disableActions: true,
47438
+ isLoading: true
47439
+ }))), !isMobile && /*#__PURE__*/React.createElement(PaymentDetailsActions, {
47440
+ obligations: obligations,
47441
+ autoPayEnabled: autoPayEnabled,
47442
+ autoPayAvailable: autoPayAvailable,
47443
+ handleAutopayAction: handleAutopayAction,
47444
+ deactivatePaymentSchedule: deactivatePaymentSchedule,
47445
+ autoPaySchedule: autoPaySchedule,
47446
+ paymentPlanSchedule: paymentPlanSchedule,
47447
+ navigateToSettings: navigateToSettings,
47448
+ config: config,
47449
+ actions: actions,
47450
+ isMobile: isMobile,
47451
+ description: description,
47452
+ subDescription: subDescription,
47453
+ disableActions: true,
47454
+ cartEnabled: cartEnabled,
47455
+ cartConfig: cartConfig,
47456
+ multiCartParams: multiCartParams,
47457
+ isInCart: isInCart,
47458
+ isContentLoading: true
47459
+ }))), isMobile && /*#__PURE__*/React.createElement(PaymentDetailsActions, {
47460
+ obligations: obligations,
47461
+ autoPayEnabled: autoPayEnabled,
47462
+ autoPayAvailable: autoPayAvailable,
47463
+ handleAutopayAction: handleAutopayAction,
47464
+ deactivatePaymentSchedule: deactivatePaymentSchedule,
47465
+ autoPaySchedule: autoPaySchedule,
47466
+ paymentPlanSchedule: paymentPlanSchedule,
47467
+ navigateToSettings: navigateToSettings,
47468
+ config: config,
47469
+ actions: actions,
47470
+ isMobile: isMobile,
47471
+ description: description,
47472
+ subDescription: subDescription,
47473
+ disableActions: true,
47474
+ cartEnabled: cartEnabled,
47475
+ cartConfig: cartConfig,
47476
+ multiCartParams: multiCartParams,
47477
+ isInCart: isInCart,
47478
+ isContentLoading: true
47479
+ }));
47372
47480
  var activeObligation = /*#__PURE__*/React.createElement(Box, {
47373
47481
  padding: "0",
47374
47482
  borderRadius: "4px",
@@ -47547,7 +47655,7 @@ var Obligation = function Obligation(_ref) {
47547
47655
  allowedPaymentInstruments: allowedPaymentInstruments,
47548
47656
  disableActions: isInCustomerManagement
47549
47657
  }))));
47550
- return inactive ? inactiveObligation : activeObligation;
47658
+ return isLoading ? loadingObligation : inactive ? inactiveObligation : activeObligation;
47551
47659
  };
47552
47660
  var Obligation$1 = themeComponent(Obligation, "Obligation", fallbackValues$N);
47553
47661