@thecb/components 9.5.0-beta.3 → 9.5.0-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "9.5.0-beta.3",
3
+ "version": "9.5.0-beta.4",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -22,7 +22,8 @@ const PartialAmountForm = ({
22
22
  clearOnDismount,
23
23
  fields,
24
24
  actions,
25
- showErrors = false
25
+ showErrors = false,
26
+ dataQa
26
27
  }) => {
27
28
  if (clearOnDismount) {
28
29
  useEffect(() => () => actions.form.clear(), []);
@@ -54,7 +55,12 @@ const PartialAmountForm = ({
54
55
 
55
56
  const lineItemsNew = Array.isArray(lineItems) ? lineItems : [];
56
57
  return (
57
- <FormContainer variant={variant} role="form" aria-label="Other amount">
58
+ <FormContainer
59
+ variant={variant}
60
+ role="form"
61
+ aria-label="Other amount"
62
+ data-qa={dataQa}
63
+ >
58
64
  <Text variant="p">
59
65
  Pay a different amount. The total balance will still be due on the same
60
66
  due date.
@@ -101,7 +101,12 @@ const InnerRadioSection = ({
101
101
  ? () => toggleOpenSection(section.id)
102
102
  : noop
103
103
  }
104
- dataQa={section.dataQa ? section.dataQa : section.id}
104
+ id={`inner-radio-section-${sectionIndex}`}
105
+ data-qa={
106
+ section.dataQa
107
+ ? section.dataQa
108
+ : section.id || `inner-radio-section-${sectionIndex}`
109
+ }
105
110
  >
106
111
  <Stack childGap="0">
107
112
  <Box
@@ -128,17 +128,13 @@ const RadioSection = ({
128
128
  </Fragment>
129
129
  ))}
130
130
  {!!groupedSections &&
131
- groupedSections.map(sectionGroup =>
131
+ groupedSections.map((sectionGroup, sectionGroupindex) =>
132
132
  sectionGroup
133
133
  .filter(unfilteredSection => !unfilteredSection.hidden)
134
- .map((section, i) => (
135
- <Fragment
136
- key={`radio-section-${groupedSections.indexOf(
137
- sectionGroup
138
- )}-${sectionGroup.indexOf(section)}}`}
139
- >
134
+ .map((section, sectionIndex) => (
135
+ <Fragment key={`key-${sectionGroupindex}-${sectionIndex}}`}>
140
136
  <InnerRadioSection
141
- sectionIndex={i}
137
+ sectionIndex={`radio-section-inner-${sectionGroupindex}-${sectionIndex}}`}
142
138
  section={section}
143
139
  sectionRefs={sectionRefs}
144
140
  focused={focused}