@thecb/components 9.3.0-beta.1 → 9.3.0-beta.2

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.3.0-beta.1",
3
+ "version": "9.3.0-beta.2",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -39,6 +39,7 @@ const FormWrapper = ({
39
39
  countryCode={countryCode}
40
40
  labelTextWhenNoError={labelTextWhenNoError}
41
41
  showErrors={showErrors}
42
+ isRequired={true}
42
43
  />
43
44
  );
44
45
 
@@ -122,6 +122,7 @@ const PaymentFormCard = ({
122
122
  showErrors={showErrors}
123
123
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
124
124
  autocompleteValue="cc-name"
125
+ isRequired={true}
125
126
  />
126
127
  <FormInput
127
128
  labelTextWhenNoError="Credit card number"
@@ -134,6 +135,7 @@ const PaymentFormCard = ({
134
135
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
135
136
  isNum
136
137
  autocompleteValue="cc-number"
138
+ isRequired={true}
137
139
  />
138
140
  <FormInputRow
139
141
  breakpoint={isMobile ? "1000rem" : "21rem"}
@@ -151,6 +153,7 @@ const PaymentFormCard = ({
151
153
  isNum
152
154
  removeFromValue={/\//} // removes "/" from browser autofill
153
155
  autocompleteValue="cc-exp"
156
+ isRequired={true}
154
157
  />
155
158
  <FormInput
156
159
  labelTextWhenNoError="CVV"
@@ -167,6 +170,7 @@ const PaymentFormCard = ({
167
170
  }
168
171
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
169
172
  autocompleteValue="cc-csc"
173
+ isRequired={true}
170
174
  />
171
175
  </FormInputRow>
172
176
  {!hideZipCode && (
@@ -185,6 +189,7 @@ const PaymentFormCard = ({
185
189
  showErrors={showErrors}
186
190
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
187
191
  autocompleteValue="billing postal-code"
192
+ isRequired={true}
188
193
  />
189
194
  </Box>
190
195
  )}
@@ -206,6 +211,7 @@ const PaymentFormCard = ({
206
211
  showCheckbox={false}
207
212
  description="View"
208
213
  terms={termsContent}
214
+ isRequired={true}
209
215
  />
210
216
  </Cover>
211
217
  )}
@@ -177,6 +177,7 @@ const RadioSection = ({
177
177
  : () => toggleOpenSection(section.id)
178
178
  }
179
179
  tabIndex="-1"
180
+ required={section?.required}
180
181
  />
181
182
  </Box>
182
183
  )}
@@ -197,7 +198,7 @@ const RadioSection = ({
197
198
  <Cluster
198
199
  childGap="0.5rem"
199
200
  aria-label={section?.rightIconsLabel || null}
200
- role={section?.rightIconsRole || null}
201
+ role={section?.rightIconsRole || "group"}
201
202
  >
202
203
  {section.rightIcons.map(icon => (
203
204
  <RightIcon
@@ -49,9 +49,10 @@ const sections = [
49
49
  title: "New Card",
50
50
  content: <p>The form to add a credit card would go here.</p>,
51
51
  rightIconsLabel: cardIconsLabel,
52
- rightIcons: cardIcons
52
+ rightIcons: cardIcons,
53
+ required: true
53
54
  },
54
- { id: "bar", title: "Bar", content: <div>Content 1</div> },
55
+ { id: "bar", title: "Bar", content: <div>Content 1</div>, required: true },
55
56
  { id: "baz", title: "Baz", content: <div>Content 2</div> }
56
57
  ];
57
58
 
@@ -19,7 +19,8 @@ const RadioButton = ({
19
19
  ariaDescribedBy = "",
20
20
  themeValues,
21
21
  ariaLabelledBy = "",
22
- ariaLabel = null
22
+ ariaLabel = null,
23
+ required = false
23
24
  }) => {
24
25
  const buttonBorder = {
25
26
  onFocused: {
@@ -90,6 +91,8 @@ const RadioButton = ({
90
91
  type="radio"
91
92
  id={`radio-${name}`}
92
93
  disabled={disabled}
94
+ required={required}
95
+ aria-required={required}
93
96
  onClick={toggleRadio}
94
97
  aria-describedby={ariaDescribedBy}
95
98
  tabIndex="-1"