@thecb/components 11.1.9-beta.0 → 11.1.10-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.cjs.js +37 -79
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +37 -79
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/radio-button-with-label/RadioButtonWithLabel.js +13 -7
- package/src/components/atoms/radio-button-with-label/RadioButtonWithLabel.theme.js +9 -3
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.js +11 -50
- package/src/components/molecules/multiple-select-filter/__private__/FilterButton.js +1 -3
- package/src/components/molecules/multiple-select-filter/__private__/util.js +0 -13
- package/src/components/molecules/obligation/Obligation.js +3 -1
- package/src/components/molecules/obligation/modules/AutopayModalModule.js +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -28470,10 +28470,12 @@ var ProcessingFee = function ProcessingFee(_ref) {
|
|
|
28470
28470
|
var ProcessingFee$1 = themeComponent(ProcessingFee, "ProcessingFee", fallbackValues$w, "default");
|
|
28471
28471
|
|
|
28472
28472
|
var activeColor$6 = MATISSE_BLUE;
|
|
28473
|
+
var disabledColor$1 = MANATEE_GREY;
|
|
28473
28474
|
var inactiveBorderColor = GREY_CHATEAU;
|
|
28474
28475
|
var fallbackValues$x = {
|
|
28475
|
-
|
|
28476
|
-
|
|
28476
|
+
activeColor: activeColor$6,
|
|
28477
|
+
disabledColor: disabledColor$1,
|
|
28478
|
+
inactiveBorderColor: inactiveBorderColor
|
|
28477
28479
|
};
|
|
28478
28480
|
|
|
28479
28481
|
var HiddenRadioInput = styled__default.input.withConfig({
|
|
@@ -28484,8 +28486,8 @@ var Circle = styled__default.div.withConfig({
|
|
|
28484
28486
|
displayName: "RadioButtonWithLabel__Circle",
|
|
28485
28487
|
componentId: "sc-1m9whwg-1"
|
|
28486
28488
|
})(["flex-shrink:0;margin-right:8px;width:1.5rem;height 1.5rem;border:", ";border-radius:50%;box-sizing:border-box;padding:2px;:after{content:\"\";width:100%;height:100%;display:block;background:", ";border-radius:50%;transform:scale(0);}"], function (_ref) {
|
|
28487
|
-
var
|
|
28488
|
-
return "1px solid ".concat(
|
|
28489
|
+
var borderColor = _ref.borderColor;
|
|
28490
|
+
return "1px solid ".concat(borderColor);
|
|
28489
28491
|
}, function (_ref2) {
|
|
28490
28492
|
var activeColor = _ref2.activeColor;
|
|
28491
28493
|
return activeColor;
|
|
@@ -28494,11 +28496,11 @@ var InputAndLabelContainer = styled__default(Cluster).withConfig({
|
|
|
28494
28496
|
displayName: "RadioButtonWithLabel__InputAndLabelContainer",
|
|
28495
28497
|
componentId: "sc-1m9whwg-2"
|
|
28496
28498
|
})(["overflow:visible;", ":checked + label ", ":after{transform:scale(0.85);transition:transform 0.15s;}", ":checked + label ", "{border:", "}", ":focus + label ", "{{box-shadow:", "}"], HiddenRadioInput, Circle, HiddenRadioInput, Circle, function (_ref3) {
|
|
28497
|
-
var
|
|
28498
|
-
return "1px solid ".concat(
|
|
28499
|
+
var borderColor = _ref3.borderColor;
|
|
28500
|
+
return "1px solid ".concat(borderColor, ";");
|
|
28499
28501
|
}, HiddenRadioInput, Circle, function (_ref4) {
|
|
28500
|
-
var
|
|
28501
|
-
return "0px 0px 2px 1px ".concat(
|
|
28502
|
+
var borderColor = _ref4.borderColor;
|
|
28503
|
+
return "0px 0px 2px 1px ".concat(borderColor, ";");
|
|
28502
28504
|
});
|
|
28503
28505
|
var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
|
|
28504
28506
|
var _ref5$id = _ref5.id,
|
|
@@ -28515,7 +28517,9 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
|
|
|
28515
28517
|
_ref5$handleChange = _ref5.handleChange,
|
|
28516
28518
|
handleChange = _ref5$handleChange === void 0 ? noop$1 : _ref5$handleChange,
|
|
28517
28519
|
field = _ref5.field,
|
|
28518
|
-
config = _ref5.config
|
|
28520
|
+
config = _ref5.config,
|
|
28521
|
+
_ref5$disabled = _ref5.disabled,
|
|
28522
|
+
disabled = _ref5$disabled === void 0 ? false : _ref5$disabled;
|
|
28519
28523
|
var getDefaultChecked = function getDefaultChecked(value, idx) {
|
|
28520
28524
|
var selectionExistsInConfig = config === null || config === void 0 ? void 0 : config.map(function (c) {
|
|
28521
28525
|
return c.value;
|
|
@@ -28530,8 +28534,9 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
|
|
|
28530
28534
|
return /*#__PURE__*/React__default.createElement(InputAndLabelContainer, {
|
|
28531
28535
|
align: "center",
|
|
28532
28536
|
childGap: "0.5rem",
|
|
28533
|
-
|
|
28537
|
+
borderColor: disabled ? themeValues.inactiveBorderColor : themeValues.activeColor
|
|
28534
28538
|
}, /*#__PURE__*/React__default.createElement(HiddenRadioInput, {
|
|
28539
|
+
disabled: disabled,
|
|
28535
28540
|
"aria-invalid": ariaInvalid,
|
|
28536
28541
|
style: {
|
|
28537
28542
|
marginTop: 0
|
|
@@ -28550,8 +28555,8 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
|
|
|
28550
28555
|
htmlFor: id,
|
|
28551
28556
|
extraStyles: "\n font-size: 1rem;\n display: flex; \n width: 100%;\n :hover {\n cursor: pointer;\n }\n "
|
|
28552
28557
|
}, /*#__PURE__*/React__default.createElement(Circle, {
|
|
28553
|
-
activeColor: themeValues.activeColor,
|
|
28554
|
-
|
|
28558
|
+
activeColor: disabled ? themeValues.disabledColor : themeValues.activeColor,
|
|
28559
|
+
borderColor: themeValues.inactiveBorderColor
|
|
28555
28560
|
}), labelText));
|
|
28556
28561
|
};
|
|
28557
28562
|
var RadioButtonWithLabel$1 = themeComponent(RadioButtonWithLabel, "RadioButtonWithLabel", fallbackValues$x);
|
|
@@ -46471,7 +46476,7 @@ var iconsMap = (_iconsMap = {}, _defineProperty(_defineProperty(_defineProperty(
|
|
|
46471
46476
|
|
|
46472
46477
|
var disabledBackgroundColor$1 = TRANSPARENT;
|
|
46473
46478
|
var disabledBorderColor$1 = GHOST_GREY;
|
|
46474
|
-
var disabledColor$
|
|
46479
|
+
var disabledColor$2 = MANATEE_GREY;
|
|
46475
46480
|
var activeBackgroundColor$1 = CORNFLOWER_BLUE;
|
|
46476
46481
|
var backgroundColor$a = LINK_WATER;
|
|
46477
46482
|
var borderColor$5 = MOON_RAKER;
|
|
@@ -46479,7 +46484,7 @@ var color$b = ROYAL_BLUE_VIVID;
|
|
|
46479
46484
|
var fallbackValues$L = {
|
|
46480
46485
|
disabledBackgroundColor: disabledBackgroundColor$1,
|
|
46481
46486
|
disabledBorderColor: disabledBorderColor$1,
|
|
46482
|
-
disabledColor: disabledColor$
|
|
46487
|
+
disabledColor: disabledColor$2,
|
|
46483
46488
|
activeBackgroundColor: activeBackgroundColor$1,
|
|
46484
46489
|
backgroundColor: backgroundColor$a,
|
|
46485
46490
|
borderColor: borderColor$5,
|
|
@@ -46845,8 +46850,8 @@ var AutopayModalModule = function AutopayModalModule(_ref) {
|
|
|
46845
46850
|
onClick = _ref.onClick,
|
|
46846
46851
|
onKeyPress = _ref.onKeyPress;
|
|
46847
46852
|
var generateMethodNeededText = function generateMethodNeededText(planText, allowedPaymentInstruments) {
|
|
46848
|
-
var allowsCard = allowedPaymentInstruments.includes(CC_METHOD);
|
|
46849
|
-
var allowsACH = allowedPaymentInstruments.includes(ACH_METHOD);
|
|
46853
|
+
var allowsCard = allowedPaymentInstruments === null || allowedPaymentInstruments === void 0 ? void 0 : allowedPaymentInstruments.includes(CC_METHOD);
|
|
46854
|
+
var allowsACH = allowedPaymentInstruments === null || allowedPaymentInstruments === void 0 ? void 0 : allowedPaymentInstruments.includes(ACH_METHOD);
|
|
46850
46855
|
var methodRequired = allowsCard && !allowsACH ? "debit or credit card payment method" : !allowsCard && allowsACH ? "checking account payment method" : "payment method";
|
|
46851
46856
|
return "To set up ".concat(planText, " you must have a saved ").concat(methodRequired, " and address. Do you want to save these now?");
|
|
46852
46857
|
};
|
|
@@ -47354,7 +47359,8 @@ var fallbackValues$N = {
|
|
|
47354
47359
|
var Obligation = function Obligation(_ref) {
|
|
47355
47360
|
var _obligations$, _firstObligation$cust;
|
|
47356
47361
|
var config = _ref.config,
|
|
47357
|
-
obligations = _ref.obligations,
|
|
47362
|
+
_ref$obligations = _ref.obligations,
|
|
47363
|
+
obligations = _ref$obligations === void 0 ? [] : _ref$obligations,
|
|
47358
47364
|
actions = _ref.actions,
|
|
47359
47365
|
autoPayEnabled = _ref.autoPayEnabled,
|
|
47360
47366
|
autoPayAvailable = _ref.autoPayAvailable,
|
|
@@ -47454,6 +47460,7 @@ var Obligation = function Obligation(_ref) {
|
|
|
47454
47460
|
isLoading: true
|
|
47455
47461
|
}))), !isMobile && /*#__PURE__*/React__default.createElement(PaymentDetailsActions, {
|
|
47456
47462
|
obligations: obligations,
|
|
47463
|
+
obligationAssocID: obligationAssocID,
|
|
47457
47464
|
autoPayEnabled: autoPayEnabled,
|
|
47458
47465
|
autoPayAvailable: autoPayAvailable,
|
|
47459
47466
|
handleAutopayAction: handleAutopayAction,
|
|
@@ -47474,6 +47481,7 @@ var Obligation = function Obligation(_ref) {
|
|
|
47474
47481
|
isContentLoading: true
|
|
47475
47482
|
}))), isMobile && /*#__PURE__*/React__default.createElement(PaymentDetailsActions, {
|
|
47476
47483
|
obligations: obligations,
|
|
47484
|
+
obligationAssocID: obligationAssocID,
|
|
47477
47485
|
autoPayEnabled: autoPayEnabled,
|
|
47478
47486
|
autoPayAvailable: autoPayAvailable,
|
|
47479
47487
|
handleAutopayAction: handleAutopayAction,
|
|
@@ -50735,8 +50743,7 @@ var FilterButton$1 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
50735
50743
|
truncateBtnTextWidth = _ref.truncateBtnTextWidth,
|
|
50736
50744
|
filterLabel = _ref.filterLabel,
|
|
50737
50745
|
selectedOptions = _ref.selectedOptions,
|
|
50738
|
-
extraStyles = _ref.extraStyles
|
|
50739
|
-
dataAppliedOptions = _ref.dataAppliedOptions;
|
|
50746
|
+
extraStyles = _ref.extraStyles;
|
|
50740
50747
|
var btnTextFilterDescription = selectedOptions !== null && selectedOptions !== void 0 && selectedOptions.length ? "".concat(filterLabel ? "".concat(filterLabel, ": ") : "").concat(selectedOptions[0].name) : "".concat(filterLabel ? filterLabel : "");
|
|
50741
50748
|
var btnTextItemsDescription = selectedOptions !== null && selectedOptions !== void 0 && selectedOptions.length && (selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.length) > 1 ? ", +".concat((selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.length) - 1, " More") : "";
|
|
50742
50749
|
return /*#__PURE__*/React__default.createElement(StyledFilterButton, {
|
|
@@ -50754,7 +50761,6 @@ var FilterButton$1 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
50754
50761
|
dataQa: "".concat(name, "-filter-button"),
|
|
50755
50762
|
extraStyles: extraStyles,
|
|
50756
50763
|
"aria-label": "".concat(filterLabel, " Filter: ").concat(btnTextFilterDescription, " ").concat(btnTextItemsDescription),
|
|
50757
|
-
"data-applied-options": dataAppliedOptions,
|
|
50758
50764
|
contentOverride: true
|
|
50759
50765
|
}, btnContentOverride ? btnContentOverride : /*#__PURE__*/React__default.createElement(Center, {
|
|
50760
50766
|
as: "span",
|
|
@@ -50939,19 +50945,6 @@ var selectOption = function selectOption(option, selectedOptions, setSelectedOpt
|
|
|
50939
50945
|
setSelectedOptions(moreOptions);
|
|
50940
50946
|
}
|
|
50941
50947
|
};
|
|
50942
|
-
var mergeOptions = function mergeOptions(selectedOptions, activeOptions) {
|
|
50943
|
-
if (!activeOptions.length) return selectedOptions;
|
|
50944
|
-
if (!selectedOptions.length) return activeOptions;
|
|
50945
|
-
var mergedOptions = _toConsumableArray(selectedOptions);
|
|
50946
|
-
activeOptions.forEach(function (activeOption) {
|
|
50947
|
-
if (!mergedOptions.some(function (option) {
|
|
50948
|
-
return option.name === activeOption.name;
|
|
50949
|
-
})) {
|
|
50950
|
-
mergedOptions.push(activeOption);
|
|
50951
|
-
}
|
|
50952
|
-
});
|
|
50953
|
-
return mergedOptions;
|
|
50954
|
-
};
|
|
50955
50948
|
|
|
50956
50949
|
var useKeyboardNavigation = function useKeyboardNavigation(_ref) {
|
|
50957
50950
|
var options = _ref.options,
|
|
@@ -51152,75 +51145,41 @@ var MultipleSelectFilter = function MultipleSelectFilter(_ref) {
|
|
|
51152
51145
|
searchable = _ref$searchable === void 0 ? true : _ref$searchable,
|
|
51153
51146
|
themeValues = _ref.themeValues,
|
|
51154
51147
|
_ref$truncateBtnTextW = _ref.truncateBtnTextWidth,
|
|
51155
|
-
truncateBtnTextWidth = _ref$truncateBtnTextW === void 0 ? "15rem" : _ref$truncateBtnTextW
|
|
51156
|
-
activeAppliedOptions = _ref.activeAppliedOptions;
|
|
51157
|
-
// State to manage whether the dropdown is open or closed
|
|
51148
|
+
truncateBtnTextWidth = _ref$truncateBtnTextW === void 0 ? "15rem" : _ref$truncateBtnTextW;
|
|
51158
51149
|
var _useState = React.useState(false),
|
|
51159
51150
|
_useState2 = _slicedToArray(_useState, 2),
|
|
51160
51151
|
opened = _useState2[0],
|
|
51161
51152
|
setOpened = _useState2[1];
|
|
51162
|
-
|
|
51163
|
-
// State to manage the currently selected options
|
|
51164
51153
|
var _useState3 = React.useState([]),
|
|
51165
51154
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
51166
51155
|
selectedOptions = _useState4[0],
|
|
51167
51156
|
setSelectedOptions = _useState4[1];
|
|
51168
|
-
|
|
51169
|
-
// State to manage the applied options, initialized with activeAppliedOptions or an empty array
|
|
51170
|
-
var _useState5 = React.useState(activeAppliedOptions || []),
|
|
51157
|
+
var _useState5 = React.useState([]),
|
|
51171
51158
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
51172
51159
|
appliedOptions = _useState6[0],
|
|
51173
51160
|
setAppliedOptions = _useState6[1];
|
|
51174
|
-
|
|
51175
|
-
// State to track whether the user has interacted with the component
|
|
51176
|
-
var _useState7 = React.useState(false),
|
|
51177
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
51178
|
-
hasInteracted = _useState8[0],
|
|
51179
|
-
setHasInteracted = _useState8[1];
|
|
51180
|
-
|
|
51181
|
-
// Reference to keep track of the opened state across renders without causing re-renders
|
|
51182
51161
|
var openedRef = React.useRef(opened);
|
|
51183
|
-
|
|
51184
|
-
|
|
51162
|
+
var handleOnClose = function handleOnClose() {
|
|
51163
|
+
if (openedRef.current) {
|
|
51164
|
+
setOpened(false);
|
|
51165
|
+
actions.fields.searchTerm.set("");
|
|
51166
|
+
}
|
|
51167
|
+
};
|
|
51185
51168
|
var containerRef = useOutsideClickHook(function () {
|
|
51186
51169
|
return handleOnClose();
|
|
51187
51170
|
});
|
|
51188
|
-
|
|
51189
|
-
// References to various elements within the component
|
|
51190
51171
|
var dropdownRef = React.useRef(null);
|
|
51191
51172
|
var filterButtonRef = React.useRef(null);
|
|
51192
51173
|
var applyFilterButtonRef = React.useRef(null);
|
|
51193
|
-
|
|
51194
|
-
// IDs for accessibility and identification purposes
|
|
51195
51174
|
var filterDropdownID = "".concat(name, "-filter-dropdown");
|
|
51196
51175
|
var listGroupID = "".concat(name, "-list-group");
|
|
51197
|
-
var handleOnClose = function handleOnClose() {
|
|
51198
|
-
if (openedRef.current) {
|
|
51199
|
-
setOpened(false);
|
|
51200
|
-
actions.fields.searchTerm.set("");
|
|
51201
|
-
}
|
|
51202
|
-
};
|
|
51203
51176
|
React.useEffect(function () {
|
|
51204
51177
|
openedRef.current = opened;
|
|
51205
51178
|
if (!opened) {
|
|
51206
|
-
|
|
51207
|
-
|
|
51208
|
-
setAppliedOptions(selectedOptions);
|
|
51209
|
-
}
|
|
51210
|
-
} else {
|
|
51211
|
-
setHasInteracted(true);
|
|
51179
|
+
onApply(selectedOptions);
|
|
51180
|
+
setAppliedOptions(selectedOptions);
|
|
51212
51181
|
}
|
|
51213
51182
|
}, [opened]);
|
|
51214
|
-
React.useEffect(function () {
|
|
51215
|
-
// Update the applied options state with the current active applied options,
|
|
51216
|
-
// or an empty array if activeAppliedOptions is undefined or null.
|
|
51217
|
-
// This ensures that the current applied options are in sync with the parent component.
|
|
51218
|
-
setAppliedOptions(activeAppliedOptions || []);
|
|
51219
|
-
|
|
51220
|
-
// Merge the selected options with the active applied options.
|
|
51221
|
-
var mergedSelections = mergeOptions(selectedOptions, activeAppliedOptions);
|
|
51222
|
-
setSelectedOptions(mergedSelections);
|
|
51223
|
-
}, [activeAppliedOptions]);
|
|
51224
51183
|
React.useEffect(function () {
|
|
51225
51184
|
var handleKeyDown = function handleKeyDown(event) {
|
|
51226
51185
|
if (event.key === "Escape") {
|
|
@@ -51262,8 +51221,7 @@ var MultipleSelectFilter = function MultipleSelectFilter(_ref) {
|
|
|
51262
51221
|
truncateBtnTextWidth: truncateBtnTextWidth,
|
|
51263
51222
|
filterLabel: filterLabel,
|
|
51264
51223
|
selectedOptions: selectedOptions,
|
|
51265
|
-
extraStyles: btnExtraStyles
|
|
51266
|
-
dataAppliedOptions: appliedOptions === null || appliedOptions === void 0 ? void 0 : appliedOptions.length
|
|
51224
|
+
extraStyles: btnExtraStyles
|
|
51267
51225
|
}), /*#__PURE__*/React__default.createElement(FilterDropdown, {
|
|
51268
51226
|
id: filterDropdownID,
|
|
51269
51227
|
ref: dropdownRef,
|