@thecb/components 9.0.3-beta.9 → 9.0.3
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 +17 -23
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +17 -23
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/radio-section/RadioSection.js +21 -30
- package/src/components/molecules/radio-section/RadioSection.stories.js +40 -1
package/dist/index.cjs.js
CHANGED
|
@@ -48486,7 +48486,7 @@ var fallbackValues$Q = {
|
|
|
48486
48486
|
|
|
48487
48487
|
*/
|
|
48488
48488
|
|
|
48489
|
-
var
|
|
48489
|
+
var idString = function idString(section) {
|
|
48490
48490
|
return typeof section.title === "string" ? createIdFromString(section.title) : section.id;
|
|
48491
48491
|
};
|
|
48492
48492
|
|
|
@@ -48507,12 +48507,7 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48507
48507
|
openHeight = _ref$openHeight === void 0 ? "auto" : _ref$openHeight,
|
|
48508
48508
|
_ref$containerStyles = _ref.containerStyles,
|
|
48509
48509
|
containerStyles = _ref$containerStyles === void 0 ? "" : _ref$containerStyles,
|
|
48510
|
-
ariaDescribedBy = _ref.ariaDescribedBy
|
|
48511
|
-
_ref$rightContentRole = _ref.rightContentRole,
|
|
48512
|
-
rightContentRole = _ref$rightContentRole === void 0 ? null : _ref$rightContentRole,
|
|
48513
|
-
_ref$ariaLabel = _ref.ariaLabel,
|
|
48514
|
-
_ref$rightIconsLabel = _ref.rightIconsLabel,
|
|
48515
|
-
rightIconsLabel = _ref$rightIconsLabel === void 0 ? null : _ref$rightIconsLabel;
|
|
48510
|
+
ariaDescribedBy = _ref.ariaDescribedBy;
|
|
48516
48511
|
|
|
48517
48512
|
var handleKeyDown = function handleKeyDown(id, e) {
|
|
48518
48513
|
if ((e === null || e === void 0 ? void 0 : e.keyCode) === 13 || (e === null || e === void 0 ? void 0 : e.keyCode) === 32) {
|
|
@@ -48589,7 +48584,8 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48589
48584
|
key: "item-".concat(section.id),
|
|
48590
48585
|
extraStyles: borderStyles,
|
|
48591
48586
|
role: "radio",
|
|
48592
|
-
"aria-checked": openSection === section.id
|
|
48587
|
+
"aria-checked": openSection === section.id,
|
|
48588
|
+
"aria-disabled": section.disabled
|
|
48593
48589
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
48594
48590
|
childGap: "0"
|
|
48595
48591
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
@@ -48619,10 +48615,9 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48619
48615
|
}, !section.hideRadioButton && /*#__PURE__*/React__default.createElement(Box, {
|
|
48620
48616
|
padding: "0"
|
|
48621
48617
|
}, /*#__PURE__*/React__default.createElement(RadioButton$2, {
|
|
48622
|
-
id:
|
|
48623
|
-
name:
|
|
48618
|
+
id: "radio-input-".concat(idString(section)),
|
|
48619
|
+
name: idString(section),
|
|
48624
48620
|
ariaDescribedBy: ariaDescribedBy,
|
|
48625
|
-
ariaLabelledBy: "radio-input-".concat(computeSectionId(section)),
|
|
48626
48621
|
radioOn: openSection === section.id,
|
|
48627
48622
|
radioFocused: focused === section.id,
|
|
48628
48623
|
toggleRadio: section.disabled ? noop : function () {
|
|
@@ -48635,23 +48630,22 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48635
48630
|
padding: section.titleIcon ? "0 0 0 8px" : "0"
|
|
48636
48631
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
48637
48632
|
as: "label",
|
|
48638
|
-
|
|
48639
|
-
|
|
48633
|
+
htmlFor: "radio-input-".concat(idString(section)),
|
|
48634
|
+
color: CHARADE_GREY
|
|
48640
48635
|
}, section.title))), section.rightIcons && /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48641
|
-
childGap: "0.5rem"
|
|
48642
|
-
|
|
48643
|
-
|
|
48644
|
-
}
|
|
48645
|
-
return /*#__PURE__*/React__default.createElement(RightIcon,
|
|
48636
|
+
childGap: "0.5rem",
|
|
48637
|
+
"aria-label": (section === null || section === void 0 ? void 0 : section.rightIconsLabel) || null,
|
|
48638
|
+
role: (section === null || section === void 0 ? void 0 : section.rightIconsRole) || null
|
|
48639
|
+
}, section.rightIcons.map(function (icon) {
|
|
48640
|
+
return /*#__PURE__*/React__default.createElement(RightIcon, {
|
|
48646
48641
|
src: icon.img,
|
|
48647
48642
|
key: icon.img,
|
|
48648
48643
|
fade: !icon.enabled,
|
|
48649
48644
|
isMobile: isMobile,
|
|
48650
|
-
alt: icon.altText
|
|
48651
|
-
|
|
48652
|
-
|
|
48653
|
-
|
|
48654
|
-
}))), section.rightTitleContent && /*#__PURE__*/React__default.createElement(React.Fragment, null, section.rightTitleContent))), /*#__PURE__*/React__default.createElement(AnimatePresence, {
|
|
48645
|
+
alt: icon.altText,
|
|
48646
|
+
"aria-disabled": !icon.enabled
|
|
48647
|
+
});
|
|
48648
|
+
})), section.rightTitleContent && /*#__PURE__*/React__default.createElement(React.Fragment, null, section.rightTitleContent))), /*#__PURE__*/React__default.createElement(AnimatePresence, {
|
|
48655
48649
|
initial: false
|
|
48656
48650
|
}, openSection === section.id && /*#__PURE__*/React__default.createElement(Motion, {
|
|
48657
48651
|
key: "content-".concat(section.id),
|