@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.esm.js CHANGED
@@ -48478,7 +48478,7 @@ var fallbackValues$Q = {
48478
48478
 
48479
48479
  */
48480
48480
 
48481
- var computeSectionId = function computeSectionId(section) {
48481
+ var idString = function idString(section) {
48482
48482
  return typeof section.title === "string" ? createIdFromString(section.title) : section.id;
48483
48483
  };
48484
48484
 
@@ -48499,12 +48499,7 @@ var RadioSection = function RadioSection(_ref) {
48499
48499
  openHeight = _ref$openHeight === void 0 ? "auto" : _ref$openHeight,
48500
48500
  _ref$containerStyles = _ref.containerStyles,
48501
48501
  containerStyles = _ref$containerStyles === void 0 ? "" : _ref$containerStyles,
48502
- ariaDescribedBy = _ref.ariaDescribedBy,
48503
- _ref$rightContentRole = _ref.rightContentRole,
48504
- rightContentRole = _ref$rightContentRole === void 0 ? null : _ref$rightContentRole,
48505
- _ref$ariaLabel = _ref.ariaLabel,
48506
- _ref$rightIconsLabel = _ref.rightIconsLabel,
48507
- rightIconsLabel = _ref$rightIconsLabel === void 0 ? null : _ref$rightIconsLabel;
48502
+ ariaDescribedBy = _ref.ariaDescribedBy;
48508
48503
 
48509
48504
  var handleKeyDown = function handleKeyDown(id, e) {
48510
48505
  if ((e === null || e === void 0 ? void 0 : e.keyCode) === 13 || (e === null || e === void 0 ? void 0 : e.keyCode) === 32) {
@@ -48581,7 +48576,8 @@ var RadioSection = function RadioSection(_ref) {
48581
48576
  key: "item-".concat(section.id),
48582
48577
  extraStyles: borderStyles,
48583
48578
  role: "radio",
48584
- "aria-checked": openSection === section.id
48579
+ "aria-checked": openSection === section.id,
48580
+ "aria-disabled": section.disabled
48585
48581
  }, /*#__PURE__*/React.createElement(Stack, {
48586
48582
  childGap: "0"
48587
48583
  }, /*#__PURE__*/React.createElement(Box, {
@@ -48611,10 +48607,9 @@ var RadioSection = function RadioSection(_ref) {
48611
48607
  }, !section.hideRadioButton && /*#__PURE__*/React.createElement(Box, {
48612
48608
  padding: "0"
48613
48609
  }, /*#__PURE__*/React.createElement(RadioButton$2, {
48614
- id: computeSectionId(section),
48615
- name: computeSectionId(section),
48610
+ id: "radio-input-".concat(idString(section)),
48611
+ name: idString(section),
48616
48612
  ariaDescribedBy: ariaDescribedBy,
48617
- ariaLabelledBy: "radio-input-".concat(computeSectionId(section)),
48618
48613
  radioOn: openSection === section.id,
48619
48614
  radioFocused: focused === section.id,
48620
48615
  toggleRadio: section.disabled ? noop : function () {
@@ -48627,23 +48622,22 @@ var RadioSection = function RadioSection(_ref) {
48627
48622
  padding: section.titleIcon ? "0 0 0 8px" : "0"
48628
48623
  }, /*#__PURE__*/React.createElement(Text$1, {
48629
48624
  as: "label",
48630
- color: CHARADE_GREY,
48631
- htmlFor: "radio-input-".concat(computeSectionId(section))
48625
+ htmlFor: "radio-input-".concat(idString(section)),
48626
+ color: CHARADE_GREY
48632
48627
  }, section.title))), section.rightIcons && /*#__PURE__*/React.createElement(Cluster, {
48633
- childGap: "0.5rem"
48634
- }, /*#__PURE__*/React.createElement("div", rightIconsLabel !== null ? {
48635
- "aria-label": rightIconsLabel
48636
- } : {}, section.rightIcons.map(function (icon) {
48637
- return /*#__PURE__*/React.createElement(RightIcon, _extends({
48628
+ childGap: "0.5rem",
48629
+ "aria-label": (section === null || section === void 0 ? void 0 : section.rightIconsLabel) || null,
48630
+ role: (section === null || section === void 0 ? void 0 : section.rightIconsRole) || null
48631
+ }, section.rightIcons.map(function (icon) {
48632
+ return /*#__PURE__*/React.createElement(RightIcon, {
48638
48633
  src: icon.img,
48639
48634
  key: icon.img,
48640
48635
  fade: !icon.enabled,
48641
48636
  isMobile: isMobile,
48642
- alt: icon.altText
48643
- }, rightContentRole !== null ? {
48644
- role: rightContentRole || "presentation"
48645
- } : {}));
48646
- }))), section.rightTitleContent && /*#__PURE__*/React.createElement(Fragment$1, null, section.rightTitleContent))), /*#__PURE__*/React.createElement(AnimatePresence, {
48637
+ alt: icon.altText,
48638
+ "aria-disabled": !icon.enabled
48639
+ });
48640
+ })), section.rightTitleContent && /*#__PURE__*/React.createElement(Fragment$1, null, section.rightTitleContent))), /*#__PURE__*/React.createElement(AnimatePresence, {
48647
48641
  initial: false
48648
48642
  }, openSection === section.id && /*#__PURE__*/React.createElement(Motion, {
48649
48643
  key: "content-".concat(section.id),