optimized-react-component-library-xyz123 2.8.10 → 2.8.11

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.js CHANGED
@@ -2122,6 +2122,8 @@ var RadioCollapseItem = ({
2122
2122
  (0, import_react10.useEffect)(() => {
2123
2123
  if (questionAnswer === value) {
2124
2124
  setIsOpen(true);
2125
+ } else {
2126
+ setIsOpen(false);
2125
2127
  }
2126
2128
  }, [questionAnswer, value]);
2127
2129
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "pts-radio-option", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "pts-radio-collapse", children: [
@@ -2140,7 +2142,7 @@ var RadioCollapseItem = ({
2140
2142
  }
2141
2143
  ),
2142
2144
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("label", { htmlFor: `${groupId}-option-${index}`, id: `${groupId}-label-${index}`, children: label }),
2143
- optionText && optionText.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2145
+ optionText && optionText.length > 0 && questionAnswer === value && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2144
2146
  "button",
2145
2147
  {
2146
2148
  className: `pts-radio-collapse-button ${isOpen ? "open" : ""}`,
@@ -2151,6 +2153,7 @@ var RadioCollapseItem = ({
2151
2153
  "aria-controls": contentId,
2152
2154
  "aria-label": buttonLabel,
2153
2155
  "aria-describedby": isOpen ? contentId : void 0,
2156
+ tabIndex: questionAnswer === value ? 0 : -1,
2154
2157
  children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "pts-open-close-icon", "aria-hidden": "true", children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CollapseIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ExpandIcon, {}) })
2155
2158
  }
2156
2159
  )
@@ -2160,6 +2163,7 @@ var RadioCollapseItem = ({
2160
2163
  {
2161
2164
  className: `pts-radio-collapse-body ${isOpen ? "open" : "hidden"}`,
2162
2165
  id: contentId,
2166
+ hidden: !isOpen,
2163
2167
  role: "region",
2164
2168
  "aria-labelledby": `${groupId}-label-${index}`,
2165
2169
  inert: !isOpen,