@thecb/components 9.0.3-beta.8 → 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 CHANGED
@@ -48486,7 +48486,7 @@ var fallbackValues$Q = {
48486
48486
 
48487
48487
  */
48488
48488
 
48489
- var computeSectionId = function computeSectionId(section) {
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: computeSectionId(section),
48623
- name: computeSectionId(section),
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,21 +48630,21 @@ 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
- color: CHARADE_GREY,
48639
- htmlFor: "radio-input-".concat(computeSectionId(section))
48633
+ htmlFor: "radio-input-".concat(idString(section)),
48634
+ color: CHARADE_GREY
48640
48635
  }, section.title))), section.rightIcons && /*#__PURE__*/React__default.createElement(Cluster, {
48641
48636
  childGap: "0.5rem",
48642
- "aria-label": rightIconsLabel
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
48643
48639
  }, section.rightIcons.map(function (icon) {
48644
- return /*#__PURE__*/React__default.createElement(RightIcon, _extends({
48640
+ return /*#__PURE__*/React__default.createElement(RightIcon, {
48645
48641
  src: icon.img,
48646
48642
  key: icon.img,
48647
48643
  fade: !icon.enabled,
48648
48644
  isMobile: isMobile,
48649
- alt: icon.altText
48650
- }, rightContentRole !== null ? {
48651
- role: rightContentRole || "presentation"
48652
- } : {}));
48645
+ alt: icon.altText,
48646
+ "aria-disabled": !icon.enabled
48647
+ });
48653
48648
  })), section.rightTitleContent && /*#__PURE__*/React__default.createElement(React.Fragment, null, section.rightTitleContent))), /*#__PURE__*/React__default.createElement(AnimatePresence, {
48654
48649
  initial: false
48655
48650
  }, openSection === section.id && /*#__PURE__*/React__default.createElement(Motion, {