@thecb/components 7.10.1-beta.5 → 7.10.1-beta.7
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 +7 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +7 -2
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/radio-section/RadioSection.js +7 -2
- package/src/components/molecules/radio-section/radio-button/RadioButton.js +2 -0
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ import { Box, Cluster, Stack, Motion } from "../../atoms/layouts";
|
|
|
8
8
|
import { noop } from "../../../util/general";
|
|
9
9
|
import Text from "../../atoms/text";
|
|
10
10
|
import { CHARADE_GREY } from "../../../constants/colors";
|
|
11
|
+
import { createIdFromString } from "../../../util/general";
|
|
11
12
|
/*
|
|
12
13
|
Takes an array of section objects, each object should look like:
|
|
13
14
|
{
|
|
@@ -40,7 +41,8 @@ const RadioSection = ({
|
|
|
40
41
|
toggleOpenSection,
|
|
41
42
|
staggeredAnimation = false,
|
|
42
43
|
initiallyOpen = true,
|
|
43
|
-
openHeight = "auto"
|
|
44
|
+
openHeight = "auto",
|
|
45
|
+
ariaDescribedBy
|
|
44
46
|
}) => {
|
|
45
47
|
const handleKeyDown = (id, e) => {
|
|
46
48
|
if (e?.keyCode === 13) {
|
|
@@ -157,7 +159,10 @@ const RadioSection = ({
|
|
|
157
159
|
{!section.hideRadioButton && (
|
|
158
160
|
<Box padding="0">
|
|
159
161
|
<RadioButton
|
|
160
|
-
name={
|
|
162
|
+
name={
|
|
163
|
+
createIdFromString(section.title) || section.id
|
|
164
|
+
}
|
|
165
|
+
ariaDescribedBy={ariaDescribedBy}
|
|
161
166
|
radioOn={openSection === section.id}
|
|
162
167
|
radioFocused={focused === section.id}
|
|
163
168
|
toggleRadio={
|
|
@@ -16,6 +16,7 @@ const RadioButton = ({
|
|
|
16
16
|
toggleRadio,
|
|
17
17
|
name,
|
|
18
18
|
disabled = false,
|
|
19
|
+
ariaDescribedBy = "",
|
|
19
20
|
themeValues
|
|
20
21
|
}) => {
|
|
21
22
|
const buttonBorder = {
|
|
@@ -80,6 +81,7 @@ const RadioButton = ({
|
|
|
80
81
|
aria-label={name}
|
|
81
82
|
disabled={disabled}
|
|
82
83
|
onClick={toggleRadio}
|
|
84
|
+
aria-describedby={ariaDescribedBy}
|
|
83
85
|
tabIndex="-1"
|
|
84
86
|
/>
|
|
85
87
|
<Motion
|