@thecb/components 11.1.16-beta.0 → 11.2.0-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 +58 -21
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +58 -21
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/obligation/modules/InactiveTitleModule.js +1 -1
- package/src/components/molecules/radio-section/RadioSection.js +86 -43
- package/src/components/molecules/radio-section/radio-button/RadioButton.js +9 -5
package/dist/index.esm.js
CHANGED
|
@@ -28355,21 +28355,25 @@ var RadioButton$1 = function RadioButton(_ref2) {
|
|
|
28355
28355
|
var buttonBorder = {
|
|
28356
28356
|
onFocused: {
|
|
28357
28357
|
borderColor: themeValues.activeColor,
|
|
28358
|
-
|
|
28358
|
+
outlineWidth: "3px",
|
|
28359
|
+
outlineColor: themeValues.activeColor,
|
|
28359
28360
|
outlineOffset: "2px"
|
|
28360
28361
|
},
|
|
28361
28362
|
offFocused: {
|
|
28362
28363
|
borderColor: themeValues.activeColor,
|
|
28363
|
-
|
|
28364
|
+
outlineWidth: "3px",
|
|
28365
|
+
outlineColor: themeValues.activeColor,
|
|
28364
28366
|
outlineOffset: "2px"
|
|
28365
28367
|
},
|
|
28366
28368
|
on: {
|
|
28367
28369
|
borderColor: themeValues.activeColor,
|
|
28368
|
-
|
|
28370
|
+
outlineWidth: "0px",
|
|
28371
|
+
outlineColor: "rgba(0, 0, 0, 0)"
|
|
28369
28372
|
},
|
|
28370
28373
|
off: {
|
|
28371
28374
|
borderColor: themeValues.inactiveColor,
|
|
28372
|
-
|
|
28375
|
+
outlineWidth: "0px",
|
|
28376
|
+
outlineColor: "rgba(0, 0, 0, 0)"
|
|
28373
28377
|
}
|
|
28374
28378
|
};
|
|
28375
28379
|
var buttonCenter = {
|
|
@@ -28422,7 +28426,7 @@ var RadioButton$1 = function RadioButton(_ref2) {
|
|
|
28422
28426
|
width: "24px",
|
|
28423
28427
|
variants: buttonBorder,
|
|
28424
28428
|
display: "flex",
|
|
28425
|
-
extraStyles: "justify-content: center; align-items: center;"
|
|
28429
|
+
extraStyles: "outline: 0px solid rgba(0, 0, 0, 0); justify-content: center; align-items: center;"
|
|
28426
28430
|
}, /*#__PURE__*/React.createElement(Motion, {
|
|
28427
28431
|
variants: buttonCenter,
|
|
28428
28432
|
borderRadius: "8px"
|
|
@@ -47225,7 +47229,7 @@ var InactiveTitleModule = function InactiveTitleModule(_ref) {
|
|
|
47225
47229
|
variant: "extraSmall",
|
|
47226
47230
|
as: "p",
|
|
47227
47231
|
color: BLACK
|
|
47228
|
-
}, "This may mean
|
|
47232
|
+
}, "This may mean the balance has been paid and was removed from the system, or that there was an error loading it. .".concat(autoPayEnabled ? " You may disable autopay for this account by pressing the 'Turn off Autopay' button." : ""))));
|
|
47229
47233
|
};
|
|
47230
47234
|
|
|
47231
47235
|
var iconColor = ROYAL_BLUE_VIVID;
|
|
@@ -49577,7 +49581,8 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
49577
49581
|
ariaDescribedBy = _ref.ariaDescribedBy,
|
|
49578
49582
|
_ref$isSectionRequire = _ref.isSectionRequired,
|
|
49579
49583
|
isSectionRequired = _ref$isSectionRequire === void 0 ? false : _ref$isSectionRequire,
|
|
49580
|
-
groupedSections = _ref.groupedSections,
|
|
49584
|
+
_ref$groupedSections = _ref.groupedSections,
|
|
49585
|
+
groupedSections = _ref$groupedSections === void 0 ? [] : _ref$groupedSections,
|
|
49581
49586
|
borderOverride = _ref.borderOverride,
|
|
49582
49587
|
rest = _objectWithoutProperties(_ref, _excluded$K);
|
|
49583
49588
|
var _useState = useState(null),
|
|
@@ -49587,26 +49592,54 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
49587
49592
|
var sectionRefs = useRef(_toConsumableArray(Array(sections.length)).map(function () {
|
|
49588
49593
|
return /*#__PURE__*/createRef();
|
|
49589
49594
|
}));
|
|
49590
|
-
|
|
49591
|
-
|
|
49595
|
+
|
|
49596
|
+
// Flatten the groupedSections while keeping track of indices
|
|
49597
|
+
var flattenedGroupedSections = groupedSections.flatMap(function (group, groupIndex) {
|
|
49598
|
+
return group.map(function (section, sectionIndex) {
|
|
49599
|
+
return _objectSpread2(_objectSpread2({}, section), {}, {
|
|
49600
|
+
groupIndex: groupIndex,
|
|
49601
|
+
sectionIndex: sectionIndex
|
|
49602
|
+
});
|
|
49603
|
+
});
|
|
49604
|
+
});
|
|
49605
|
+
var groupedSectionsRefs = useRef(_toConsumableArray(Array(flattenedGroupedSections.length)).map(function () {
|
|
49606
|
+
return /*#__PURE__*/createRef();
|
|
49607
|
+
}));
|
|
49608
|
+
var getFlatGroupIndex = function getFlatGroupIndex(groupIndex, sectionIndex) {
|
|
49609
|
+
return flattenedGroupedSections.findIndex(function (item) {
|
|
49610
|
+
return item.groupIndex === groupIndex && item.sectionIndex === sectionIndex;
|
|
49611
|
+
});
|
|
49612
|
+
};
|
|
49613
|
+
var handleKeyDown = function handleKeyDown(e, sectionID, sectionIndex, isGroup) {
|
|
49614
|
+
var currentTarget = e.currentTarget,
|
|
49615
|
+
target = e.target,
|
|
49616
|
+
keyCode = e.keyCode;
|
|
49617
|
+
if (currentTarget !== target) {
|
|
49592
49618
|
return;
|
|
49593
49619
|
}
|
|
49620
|
+
var refs = isGroup ? groupedSectionsRefs : sectionRefs;
|
|
49621
|
+
var currSection = isGroup ? flattenedGroupedSections : sections;
|
|
49594
49622
|
|
|
49595
49623
|
// Allow Enter and Space to select a section
|
|
49596
|
-
if (
|
|
49624
|
+
if (keyCode === ENTER || keyCode === SPACEBAR) {
|
|
49597
49625
|
e.preventDefault();
|
|
49598
|
-
toggleOpenSection(
|
|
49626
|
+
toggleOpenSection(sectionID);
|
|
49599
49627
|
}
|
|
49600
49628
|
|
|
49601
49629
|
// Allow Up and Down arrow navigation between sections
|
|
49602
|
-
if (
|
|
49603
|
-
var
|
|
49630
|
+
if (keyCode == ARROW_UP || keyCode == ARROW_DOWN || keyCode == ARROW_LEFT || keyCode == ARROW_RIGHT) {
|
|
49631
|
+
var _refs$current$nextInd;
|
|
49604
49632
|
e.preventDefault();
|
|
49605
|
-
var indexIncrement =
|
|
49606
|
-
var nextIndex = wrapIndex(
|
|
49607
|
-
|
|
49608
|
-
|
|
49609
|
-
|
|
49633
|
+
var indexIncrement = keyCode == ARROW_RIGHT || keyCode == ARROW_DOWN ? 1 : -1;
|
|
49634
|
+
var nextIndex = wrapIndex(sectionIndex + indexIncrement, currSection.length);
|
|
49635
|
+
var nextRef = refs === null || refs === void 0 || (_refs$current$nextInd = refs.current[nextIndex]) === null || _refs$current$nextInd === void 0 ? void 0 : _refs$current$nextInd.current;
|
|
49636
|
+
if (nextRef) {
|
|
49637
|
+
var _currSection$nextInde;
|
|
49638
|
+
nextRef.focus();
|
|
49639
|
+
var nextRadioID = (_currSection$nextInde = currSection[nextIndex]) === null || _currSection$nextInde === void 0 ? void 0 : _currSection$nextInde.id;
|
|
49640
|
+
setFocused(nextRadioID);
|
|
49641
|
+
toggleOpenSection(nextRadioID);
|
|
49642
|
+
}
|
|
49610
49643
|
}
|
|
49611
49644
|
};
|
|
49612
49645
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
@@ -49634,7 +49667,7 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
49634
49667
|
openSection: openSection,
|
|
49635
49668
|
toggleOpenSection: toggleOpenSection,
|
|
49636
49669
|
onKeyDown: function onKeyDown(e) {
|
|
49637
|
-
return !section.disabled && handleKeyDown(section.id,
|
|
49670
|
+
return !section.disabled && handleKeyDown(e, section.id, i);
|
|
49638
49671
|
},
|
|
49639
49672
|
ariaLabelledBy: section.id,
|
|
49640
49673
|
ariaDescribedBy: "right-icons-".concat(idString$1(section)),
|
|
@@ -49644,13 +49677,14 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
49644
49677
|
return sectionGroup.filter(function (unfilteredSection) {
|
|
49645
49678
|
return !unfilteredSection.hidden;
|
|
49646
49679
|
}).map(function (section, sectionIndex) {
|
|
49680
|
+
var flatGroupSectionIndex = getFlatGroupIndex(sectionGroupIndex, sectionIndex);
|
|
49647
49681
|
return /*#__PURE__*/React.createElement(Fragment$1, {
|
|
49648
49682
|
key: "key-".concat(sectionGroupIndex, "-").concat(sectionIndex)
|
|
49649
49683
|
}, /*#__PURE__*/React.createElement(InnerRadioSection, {
|
|
49650
49684
|
themeValues: themeValues,
|
|
49651
|
-
sectionIndex:
|
|
49685
|
+
sectionIndex: flatGroupSectionIndex,
|
|
49652
49686
|
section: section,
|
|
49653
|
-
sectionRefs:
|
|
49687
|
+
sectionRefs: groupedSectionsRefs,
|
|
49654
49688
|
focused: focused,
|
|
49655
49689
|
setFocused: setFocused,
|
|
49656
49690
|
openHeight: openHeight,
|
|
@@ -49658,6 +49692,9 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
49658
49692
|
ariaDescribedBy: "right-icons-".concat(idString$1(section)),
|
|
49659
49693
|
openSection: openSection,
|
|
49660
49694
|
toggleOpenSection: toggleOpenSection,
|
|
49695
|
+
onKeyDown: function onKeyDown(e) {
|
|
49696
|
+
return !section.disabled && handleKeyDown(e, section.id, flatGroupSectionIndex, true);
|
|
49697
|
+
},
|
|
49661
49698
|
isLastGroupedItemInSection: sectionIndex === sectionGroup.length - 1
|
|
49662
49699
|
}), sectionIndex === sectionGroup.length - 1 && sectionGroupIndex !== groupedSections.length - 1 && /*#__PURE__*/React.createElement(SolidDivider$1, {
|
|
49663
49700
|
borderSize: "1px",
|