@thecb/components 9.2.4-beta.2 → 9.2.4-beta.4
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 +9 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +9 -4
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/radio-section/RadioSection.js +6 -3
- package/src/components/molecules/radio-section/RadioSection.stories.js +7 -1
package/package.json
CHANGED
|
@@ -47,7 +47,8 @@ const RadioSection = ({
|
|
|
47
47
|
initiallyOpen = true,
|
|
48
48
|
openHeight = "auto",
|
|
49
49
|
containerStyles = "",
|
|
50
|
-
ariaDescribedBy
|
|
50
|
+
ariaDescribedBy,
|
|
51
|
+
isRequired = false
|
|
51
52
|
}) => {
|
|
52
53
|
const handleKeyDown = (id, e) => {
|
|
53
54
|
if (e?.keyCode === 13 || e?.keyCode === 32) {
|
|
@@ -105,7 +106,7 @@ const RadioSection = ({
|
|
|
105
106
|
borderRadius="4px"
|
|
106
107
|
extraStyles={containerStyles}
|
|
107
108
|
>
|
|
108
|
-
<Stack childGap="0" role="radiogroup">
|
|
109
|
+
<Stack childGap="0" role="radiogroup" required={isRequired}>
|
|
109
110
|
{sections
|
|
110
111
|
.filter(section => !section.hidden)
|
|
111
112
|
.map(section => (
|
|
@@ -122,8 +123,10 @@ const RadioSection = ({
|
|
|
122
123
|
key={`item-${section.id}`}
|
|
123
124
|
extraStyles={borderStyles}
|
|
124
125
|
role="radio"
|
|
126
|
+
aria-label={section.title}
|
|
125
127
|
aria-checked={openSection === section.id}
|
|
126
128
|
aria-disabled={section.disabled}
|
|
129
|
+
required={section?.required || isRequired}
|
|
127
130
|
>
|
|
128
131
|
<Stack childGap="0">
|
|
129
132
|
<Box
|
|
@@ -177,7 +180,7 @@ const RadioSection = ({
|
|
|
177
180
|
: () => toggleOpenSection(section.id)
|
|
178
181
|
}
|
|
179
182
|
tabIndex="-1"
|
|
180
|
-
required={section?.required}
|
|
183
|
+
required={section?.required || isRequired}
|
|
181
184
|
/>
|
|
182
185
|
</Box>
|
|
183
186
|
)}
|
|
@@ -52,7 +52,12 @@ const sections = [
|
|
|
52
52
|
rightIcons: cardIcons,
|
|
53
53
|
required: true
|
|
54
54
|
},
|
|
55
|
-
{
|
|
55
|
+
{
|
|
56
|
+
id: "new-bank-account-section",
|
|
57
|
+
title: "New Bank Account",
|
|
58
|
+
content: <div>Content 1</div>,
|
|
59
|
+
required: true
|
|
60
|
+
},
|
|
56
61
|
{ id: "baz", title: "Baz", content: <div>Content 2</div> }
|
|
57
62
|
];
|
|
58
63
|
|
|
@@ -66,6 +71,7 @@ export const radioSection = () => {
|
|
|
66
71
|
openSection={openSection}
|
|
67
72
|
staggeredAnimation={boolean("staggeredAnimation", false, "props")}
|
|
68
73
|
sections={sections}
|
|
74
|
+
isRequired={true}
|
|
69
75
|
/>
|
|
70
76
|
);
|
|
71
77
|
};
|