@thecb/components 11.1.3 → 11.1.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/dist/index.cjs.js +115 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +115 -7
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/obligation/Obligation.js +111 -2
- package/src/components/molecules/obligation/Obligation.stories.js +61 -0
- package/src/components/molecules/obligation/modules/AmountModule.js +64 -38
- package/src/components/molecules/obligation/modules/PaymentDetailsActions.js +3 -1
- package/src/components/atoms/.DS_Store +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -46949,7 +46949,9 @@ var AmountModule = function AmountModule(_ref) {
|
|
|
46949
46949
|
subDescription = _ref.subDescription,
|
|
46950
46950
|
allowedPaymentInstruments = _ref.allowedPaymentInstruments,
|
|
46951
46951
|
_ref$disableActions = _ref.disableActions,
|
|
46952
|
-
disableActions = _ref$disableActions === void 0 ? false : _ref$disableActions
|
|
46952
|
+
disableActions = _ref$disableActions === void 0 ? false : _ref$disableActions,
|
|
46953
|
+
_ref$isLoading = _ref.isLoading,
|
|
46954
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
|
|
46953
46955
|
var _useState = React.useState(false),
|
|
46954
46956
|
_useState2 = _slicedToArray(_useState, 2),
|
|
46955
46957
|
modalOpen = _useState2[0],
|
|
@@ -46962,7 +46964,25 @@ var AmountModule = function AmountModule(_ref) {
|
|
|
46962
46964
|
variant: "pS",
|
|
46963
46965
|
weight: FONT_WEIGHT_SEMIBOLD,
|
|
46964
46966
|
textAlign: "left"
|
|
46965
|
-
}, "Amount Due"), /*#__PURE__*/React__default.createElement(
|
|
46967
|
+
}, "Amount Due"), isLoading ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(LoadingLine, {
|
|
46968
|
+
minWidth: "70",
|
|
46969
|
+
maxWidth: "80",
|
|
46970
|
+
height: "26px",
|
|
46971
|
+
margin: isMobile ? "0" : "0 0 0 auto",
|
|
46972
|
+
foregroundColor: GRECIAN_GREY,
|
|
46973
|
+
style: {
|
|
46974
|
+
borderRadius: "0.125rem"
|
|
46975
|
+
}
|
|
46976
|
+
}), /*#__PURE__*/React__default.createElement(LoadingLine, {
|
|
46977
|
+
minWidth: "134",
|
|
46978
|
+
maxWidth: "178",
|
|
46979
|
+
height: "21px",
|
|
46980
|
+
margin: isMobile ? "0.25rem 0 0 0" : "0.25rem 0 0 auto",
|
|
46981
|
+
foregroundColor: GRECIAN_GREY,
|
|
46982
|
+
style: {
|
|
46983
|
+
borderRadius: "0.125rem"
|
|
46984
|
+
}
|
|
46985
|
+
})) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(AmountCallout$1, {
|
|
46966
46986
|
amount: displayCurrency(totalAmountDue),
|
|
46967
46987
|
textAlign: isMobile ? "left" : "right"
|
|
46968
46988
|
}), autoPayEnabled && /*#__PURE__*/React__default.createElement(AutopayModalModule, {
|
|
@@ -46990,7 +47010,7 @@ var AmountModule = function AmountModule(_ref) {
|
|
|
46990
47010
|
onKeyPress: disableActions ? noop$1 : function (e) {
|
|
46991
47011
|
e.key === "Enter" && toggleModal(true);
|
|
46992
47012
|
}
|
|
46993
|
-
})));
|
|
47013
|
+
}))));
|
|
46994
47014
|
};
|
|
46995
47015
|
|
|
46996
47016
|
var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
|
|
@@ -47016,7 +47036,8 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
|
|
|
47016
47036
|
disableActions = _ref$disableActions === void 0 ? false : _ref$disableActions,
|
|
47017
47037
|
cartEnabled = _ref.cartEnabled,
|
|
47018
47038
|
cartConfig = _ref.cartConfig,
|
|
47019
|
-
isInCart = _ref.isInCart
|
|
47039
|
+
isInCart = _ref.isInCart,
|
|
47040
|
+
isContentLoading = _ref.isContentLoading;
|
|
47020
47041
|
var planType = isPaymentPlan ? "Payment Plan" : "Autopay";
|
|
47021
47042
|
var _useState = React.useState(false),
|
|
47022
47043
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -47093,7 +47114,8 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
|
|
|
47093
47114
|
description: description,
|
|
47094
47115
|
subDescription: subDescription,
|
|
47095
47116
|
allowedPaymentInstruments: allowedPaymentInstruments,
|
|
47096
|
-
isInCustomerManagement: disableActions
|
|
47117
|
+
isInCustomerManagement: disableActions,
|
|
47118
|
+
isLoading: isContentLoading
|
|
47097
47119
|
}))), /*#__PURE__*/React__default.createElement(Box, {
|
|
47098
47120
|
padding: isMobile ? "16px" : "0"
|
|
47099
47121
|
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
@@ -47359,7 +47381,9 @@ var Obligation = function Obligation(_ref) {
|
|
|
47359
47381
|
_ref$multiCartParams = _ref.multiCartParams,
|
|
47360
47382
|
multiCartParams = _ref$multiCartParams === void 0 ? undefined : _ref$multiCartParams,
|
|
47361
47383
|
_ref$isInCart = _ref.isInCart,
|
|
47362
|
-
isInCart = _ref$isInCart === void 0 ? false : _ref$isInCart
|
|
47384
|
+
isInCart = _ref$isInCart === void 0 ? false : _ref$isInCart,
|
|
47385
|
+
_ref$isLoading = _ref.isLoading,
|
|
47386
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
|
|
47363
47387
|
/*
|
|
47364
47388
|
The value of obligations is always an array. It can contain:
|
|
47365
47389
|
- A single obligation
|
|
@@ -47377,6 +47401,90 @@ var Obligation = function Obligation(_ref) {
|
|
|
47377
47401
|
subDescription = _firstObligation$subD === void 0 ? obligationAssocID : _firstObligation$subD;
|
|
47378
47402
|
var customAttributes = (_firstObligation$cust = firstObligation === null || firstObligation === void 0 ? void 0 : firstObligation.customAttributes) !== null && _firstObligation$cust !== void 0 ? _firstObligation$cust : {};
|
|
47379
47403
|
var boxShadowValue = "0px 2px 4px rgba(41, 42, 51, 0.1), 0px 1px 1px 2px rgba(41, 42, 51, 0.1);";
|
|
47404
|
+
var loadingObligation = /*#__PURE__*/React__default.createElement(Box, {
|
|
47405
|
+
padding: "0",
|
|
47406
|
+
borderRadius: "4px",
|
|
47407
|
+
boxShadow: boxShadowValue,
|
|
47408
|
+
as: "section",
|
|
47409
|
+
"aria-label": "".concat(description, " - ").concat(subDescription),
|
|
47410
|
+
border: "1px solid ".concat(GRECIAN_GREY),
|
|
47411
|
+
borderWidthOverride: "1px 0 0 0"
|
|
47412
|
+
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
47413
|
+
background: WHITE,
|
|
47414
|
+
padding: isMobile ? "16px" : "24px 16px"
|
|
47415
|
+
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
47416
|
+
childGap: "24px"
|
|
47417
|
+
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
47418
|
+
key: "".concat(firstObligation === null || firstObligation === void 0 ? void 0 : firstObligation.id, "-top"),
|
|
47419
|
+
padding: "0 8px",
|
|
47420
|
+
minWidth: "100%"
|
|
47421
|
+
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
47422
|
+
justify: "space-between",
|
|
47423
|
+
align: "center",
|
|
47424
|
+
childGap: "4px",
|
|
47425
|
+
nowrap: true
|
|
47426
|
+
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
47427
|
+
padding: "0"
|
|
47428
|
+
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
47429
|
+
justify: "flex-start",
|
|
47430
|
+
align: "center"
|
|
47431
|
+
}, !isMobile && /*#__PURE__*/React__default.createElement(IconsModule, {
|
|
47432
|
+
icon: config.icon,
|
|
47433
|
+
iconDefault: config.iconDefault,
|
|
47434
|
+
configIconMap: config.iconMap,
|
|
47435
|
+
iconValue: config.iconValue,
|
|
47436
|
+
customAttributes: customAttributes,
|
|
47437
|
+
iconColor: themeValues.iconColor
|
|
47438
|
+
}), /*#__PURE__*/React__default.createElement(TitleModule, {
|
|
47439
|
+
title: description,
|
|
47440
|
+
subtitle: subDescription,
|
|
47441
|
+
titleColor: BRIGHT_GREY,
|
|
47442
|
+
isMobile: isMobile
|
|
47443
|
+
}))), !isMobile && /*#__PURE__*/React__default.createElement(AmountModule, {
|
|
47444
|
+
isMobile: isMobile,
|
|
47445
|
+
disableActions: true,
|
|
47446
|
+
isLoading: true
|
|
47447
|
+
}))), !isMobile && /*#__PURE__*/React__default.createElement(PaymentDetailsActions, {
|
|
47448
|
+
obligations: obligations,
|
|
47449
|
+
autoPayEnabled: autoPayEnabled,
|
|
47450
|
+
autoPayAvailable: autoPayAvailable,
|
|
47451
|
+
handleAutopayAction: handleAutopayAction,
|
|
47452
|
+
deactivatePaymentSchedule: deactivatePaymentSchedule,
|
|
47453
|
+
autoPaySchedule: autoPaySchedule,
|
|
47454
|
+
paymentPlanSchedule: paymentPlanSchedule,
|
|
47455
|
+
navigateToSettings: navigateToSettings,
|
|
47456
|
+
config: config,
|
|
47457
|
+
actions: actions,
|
|
47458
|
+
isMobile: isMobile,
|
|
47459
|
+
description: description,
|
|
47460
|
+
subDescription: subDescription,
|
|
47461
|
+
disableActions: true,
|
|
47462
|
+
cartEnabled: cartEnabled,
|
|
47463
|
+
cartConfig: cartConfig,
|
|
47464
|
+
multiCartParams: multiCartParams,
|
|
47465
|
+
isInCart: isInCart,
|
|
47466
|
+
isContentLoading: true
|
|
47467
|
+
}))), isMobile && /*#__PURE__*/React__default.createElement(PaymentDetailsActions, {
|
|
47468
|
+
obligations: obligations,
|
|
47469
|
+
autoPayEnabled: autoPayEnabled,
|
|
47470
|
+
autoPayAvailable: autoPayAvailable,
|
|
47471
|
+
handleAutopayAction: handleAutopayAction,
|
|
47472
|
+
deactivatePaymentSchedule: deactivatePaymentSchedule,
|
|
47473
|
+
autoPaySchedule: autoPaySchedule,
|
|
47474
|
+
paymentPlanSchedule: paymentPlanSchedule,
|
|
47475
|
+
navigateToSettings: navigateToSettings,
|
|
47476
|
+
config: config,
|
|
47477
|
+
actions: actions,
|
|
47478
|
+
isMobile: isMobile,
|
|
47479
|
+
description: description,
|
|
47480
|
+
subDescription: subDescription,
|
|
47481
|
+
disableActions: true,
|
|
47482
|
+
cartEnabled: cartEnabled,
|
|
47483
|
+
cartConfig: cartConfig,
|
|
47484
|
+
multiCartParams: multiCartParams,
|
|
47485
|
+
isInCart: isInCart,
|
|
47486
|
+
isContentLoading: true
|
|
47487
|
+
}));
|
|
47380
47488
|
var activeObligation = /*#__PURE__*/React__default.createElement(Box, {
|
|
47381
47489
|
padding: "0",
|
|
47382
47490
|
borderRadius: "4px",
|
|
@@ -47555,7 +47663,7 @@ var Obligation = function Obligation(_ref) {
|
|
|
47555
47663
|
allowedPaymentInstruments: allowedPaymentInstruments,
|
|
47556
47664
|
disableActions: isInCustomerManagement
|
|
47557
47665
|
}))));
|
|
47558
|
-
return inactive ? inactiveObligation : activeObligation;
|
|
47666
|
+
return isLoading ? loadingObligation : inactive ? inactiveObligation : activeObligation;
|
|
47559
47667
|
};
|
|
47560
47668
|
var Obligation$1 = themeComponent(Obligation, "Obligation", fallbackValues$N);
|
|
47561
47669
|
|