@thecb/components 9.3.1-beta.4 → 9.3.1-beta.6
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 +16 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +16 -17
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/solid-divider/SolidDivider.js +7 -1
- package/src/components/molecules/radio-section/RadioSection.js +11 -13
- package/src/components/molecules/radio-section/RadioSection.stories.js +14 -0
package/package.json
CHANGED
|
@@ -3,7 +3,12 @@ import { fallbackValues } from "./SolidDivider.theme";
|
|
|
3
3
|
import { themeComponent } from "../../../util/themeUtils";
|
|
4
4
|
import { Box } from "../layouts";
|
|
5
5
|
|
|
6
|
-
const SolidDivider = ({
|
|
6
|
+
const SolidDivider = ({
|
|
7
|
+
borderColor,
|
|
8
|
+
borderSize,
|
|
9
|
+
themeValues,
|
|
10
|
+
extraStyles = ""
|
|
11
|
+
}) => (
|
|
7
12
|
<Box
|
|
8
13
|
padding="0"
|
|
9
14
|
minWidth="100%"
|
|
@@ -11,6 +16,7 @@ const SolidDivider = ({ borderColor, borderSize, themeValues }) => (
|
|
|
11
16
|
borderColor={borderColor || themeValues.borderColor}
|
|
12
17
|
borderSize={borderSize || themeValues.borderSize}
|
|
13
18
|
borderWidthOverride={`0px 0px ${borderSize || themeValues.borderSize} 0px`}
|
|
19
|
+
extraStyles={extraStyles}
|
|
14
20
|
/>
|
|
15
21
|
);
|
|
16
22
|
|
|
@@ -50,7 +50,6 @@ const RadioSection = ({
|
|
|
50
50
|
containerStyles = "",
|
|
51
51
|
ariaDescribedBy,
|
|
52
52
|
isSectionRequired = false,
|
|
53
|
-
legendText = "",
|
|
54
53
|
sectionGroups = null
|
|
55
54
|
}) => {
|
|
56
55
|
const handleKeyDown = (id, e) => {
|
|
@@ -102,11 +101,16 @@ const RadioSection = ({
|
|
|
102
101
|
|
|
103
102
|
const [focused, setFocused] = useState(null);
|
|
104
103
|
const PrependedItem = ({ themeValues }) => (
|
|
105
|
-
<SolidDivider
|
|
104
|
+
<SolidDivider
|
|
105
|
+
borderSize="2px"
|
|
106
|
+
borderRadius="0 0 0 0"
|
|
107
|
+
color={themeValues.borderColor}
|
|
108
|
+
extraStyles="margin-left: -1px; margin-right: -1px; width: cacl(100% + 2px);"
|
|
109
|
+
/>
|
|
106
110
|
);
|
|
107
111
|
return (
|
|
108
112
|
<Box
|
|
109
|
-
padding="
|
|
113
|
+
padding="1px"
|
|
110
114
|
border={`1px solid ${themeValues.borderColor}`}
|
|
111
115
|
borderRadius="4px"
|
|
112
116
|
extraStyles={containerStyles}
|
|
@@ -123,8 +127,7 @@ const RadioSection = ({
|
|
|
123
127
|
<Fragment
|
|
124
128
|
key={`sectiongroup-${sectionGroups.indexOf(sectionGroup)}`}
|
|
125
129
|
>
|
|
126
|
-
{sectionGroups.indexOf(sectionGroup)
|
|
127
|
-
sectionGroups.length - 1 ? (
|
|
130
|
+
{sectionGroups.indexOf(sectionGroup) !== 0 ? (
|
|
128
131
|
<PrependedItem themeValues={themeValues} />
|
|
129
132
|
) : (
|
|
130
133
|
""
|
|
@@ -152,6 +155,7 @@ const RadioSection = ({
|
|
|
152
155
|
initial={initiallyOpen ? "open" : "closed"}
|
|
153
156
|
key={`item-${section.id}`}
|
|
154
157
|
extraStyles={borderStyles}
|
|
158
|
+
dataQa={section.dataQa}
|
|
155
159
|
role="radio"
|
|
156
160
|
aria-checked={openSection === section.id}
|
|
157
161
|
aria-disabled={section.disabled}
|
|
@@ -190,7 +194,6 @@ const RadioSection = ({
|
|
|
190
194
|
extraStyles={
|
|
191
195
|
!section.disabled ? "cursor: pointer;" : ""
|
|
192
196
|
}
|
|
193
|
-
dataQa={section.dataQa ? section.dataQa : section.id}
|
|
194
197
|
>
|
|
195
198
|
<Cluster
|
|
196
199
|
justify="space-between"
|
|
@@ -281,7 +284,7 @@ const RadioSection = ({
|
|
|
281
284
|
})}
|
|
282
285
|
{sections &&
|
|
283
286
|
sections
|
|
284
|
-
.filter(
|
|
287
|
+
.filter(unfilteredSection => !unfilteredSection.hidden)
|
|
285
288
|
.map(section => (
|
|
286
289
|
<Motion
|
|
287
290
|
tabIndex={
|
|
@@ -297,6 +300,7 @@ const RadioSection = ({
|
|
|
297
300
|
initial={initiallyOpen ? "open" : "closed"}
|
|
298
301
|
key={`item-${section.id}`}
|
|
299
302
|
extraStyles={borderStyles}
|
|
303
|
+
dataQa={section.dataQa ? section.dataQa : section.id}
|
|
300
304
|
role="radio"
|
|
301
305
|
aria-checked={openSection === section.id}
|
|
302
306
|
aria-disabled={section.disabled}
|
|
@@ -331,12 +335,6 @@ const RadioSection = ({
|
|
|
331
335
|
: ``
|
|
332
336
|
}
|
|
333
337
|
extraStyles={!section.disabled ? "cursor: pointer;" : ""}
|
|
334
|
-
dataQa={section.dataQa ? section.dataQa : section.id}
|
|
335
|
-
role="radio"
|
|
336
|
-
aria-checked={openSection === section.id}
|
|
337
|
-
aria-disabled={section.disabled}
|
|
338
|
-
aria-required={section?.required}
|
|
339
|
-
tabIndex="0"
|
|
340
338
|
>
|
|
341
339
|
<Cluster
|
|
342
340
|
justify="space-between"
|
|
@@ -52,6 +52,20 @@ const sectionGroups = [
|
|
|
52
52
|
rightIconsLabel: cardIconsLabel,
|
|
53
53
|
rightIcons: cardIcons,
|
|
54
54
|
required: true
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "new-bank-account-section",
|
|
58
|
+
title: "New Bank Account",
|
|
59
|
+
content: <p>The form to add a bank account would go here.</p>,
|
|
60
|
+
required: true
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
[
|
|
64
|
+
{
|
|
65
|
+
id: "single",
|
|
66
|
+
title: "A Single Item Section Group",
|
|
67
|
+
content: <div>Content for a single item section group.</div>,
|
|
68
|
+
required: true
|
|
55
69
|
}
|
|
56
70
|
],
|
|
57
71
|
[
|