@thecb/components 8.4.11-beta.16 → 8.4.11-beta.18

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": "8.4.11-beta.16",
3
+ "version": "8.4.11-beta.18",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -93,6 +93,7 @@ const Alert = ({
93
93
  boxShadow={enableBoxShadow ? generateShadows()?.inset?.base : ""}
94
94
  extraStyles={extraStyles}
95
95
  role="alert"
96
+ aria-atomic={true}
96
97
  >
97
98
  {maxContentWidth ? (
98
99
  <Center maxWidth={maxContentWidth}>{content}</Center>
@@ -43,7 +43,7 @@ const HiddenCheckbox = styled.input.attrs({ type: "checkbox" })`
43
43
  width: 1px;
44
44
  `;
45
45
 
46
- const StyledCheckbox = styled.input`
46
+ const StyledCheckbox = styled.div`
47
47
  display: inline-block;
48
48
  width: 24px;
49
49
  height: 24px;
@@ -125,9 +125,10 @@ const Checkbox = ({
125
125
  checked={checked}
126
126
  onChange={onChange}
127
127
  tabIndex="-1"
128
+ aria-invalid={error}
129
+ aria-describedby={error ? `${name}-error-message` : ""}
128
130
  />
129
131
  <StyledCheckbox
130
- type="checkbox"
131
132
  error={error}
132
133
  disabled={disabled}
133
134
  checked={checked}
@@ -138,8 +139,6 @@ const Checkbox = ({
138
139
  disabledStyles={themeValues.disabledStyles}
139
140
  disabledCheckedStyles={themeValues.disabledCheckedStyles}
140
141
  focusedStyles={themeValues.focusedStyles}
141
- aria-invalid={error}
142
- aria-describedby={error ? `${name}-error-message` : ""}
143
142
  >
144
143
  <CheckboxIcon
145
144
  viewBox="0 0 24 24"
@@ -333,7 +333,6 @@ const Dropdown = ({
333
333
  width="100%"
334
334
  dataQa={placeholder}
335
335
  required={options.required}
336
- aria-required={options.required}
337
336
  />
338
337
  <IconWrapper open={isOpen} onClick={onClick}>
339
338
  <DropdownIcon />
@@ -103,7 +103,6 @@ const FormInput = ({
103
103
  errorMessages,
104
104
  isNum = false,
105
105
  isEmail = false,
106
- isPhone = false,
107
106
  helperModal = false,
108
107
  field,
109
108
  fieldActions,
@@ -201,9 +200,10 @@ const FormInput = ({
201
200
  {formatter ? (
202
201
  <FormattedInputField
203
202
  aria-labelledby={createIdFromString(labelTextWhenNoError)}
204
- aria-describedby={`${createIdFromString(
205
- labelTextWhenNoError
206
- )}-error-message`}
203
+ aria-describedby={createIdFromString(
204
+ labelTextWhenNoError,
205
+ "error message"
206
+ )}
207
207
  aria-invalid={
208
208
  (field.dirty && field.hasErrors) ||
209
209
  (field.hasErrors && showErrors)
@@ -212,17 +212,7 @@ const FormInput = ({
212
212
  type={type}
213
213
  value={field.rawValue}
214
214
  pattern={isNum ? "[0-9]*" : ""}
215
- inputMode={() => {
216
- if (isNum) {
217
- return "numeric";
218
- } else if (isEmail) {
219
- return "email";
220
- } else if (isPhone) {
221
- return "tel";
222
- } else {
223
- return "text";
224
- }
225
- }}
215
+ inputMode={isNum ? "numeric" : isEmail ? "email" : "text"}
226
216
  field={field}
227
217
  formatter={formatter}
228
218
  showErrors={showErrors}
@@ -230,15 +220,16 @@ const FormInput = ({
230
220
  themeValues={themeValues}
231
221
  $customHeight={customHeight}
232
222
  $extraStyles={extraStyles}
233
- autocomplete={autocomplete}
223
+ autoComplete={autocomplete}
234
224
  {...props}
235
225
  />
236
226
  ) : (
237
227
  <InputField
238
228
  aria-labelledby={createIdFromString(labelTextWhenNoError)}
239
- aria-describedby={`${createIdFromString(
240
- labelTextWhenNoError
241
- )}-error-message`}
229
+ aria-describedby={createIdFromString(
230
+ labelTextWhenNoError,
231
+ "error message"
232
+ )}
242
233
  aria-invalid={
243
234
  (field.dirty && field.hasErrors) ||
244
235
  (field.hasErrors && showErrors)
@@ -250,7 +241,7 @@ const FormInput = ({
250
241
  inputMode={isNum ? "numeric" : isEmail ? "email" : "text"}
251
242
  field={field}
252
243
  showErrors={showErrors}
253
- data-qa={labelTextWhenNoError}
244
+ data-qa={createIdFromString(labelTextWhenNoError)}
254
245
  themeValues={themeValues}
255
246
  background={background}
256
247
  $customHeight={customHeight}
@@ -50,6 +50,7 @@ const AccountAndRoutingModal = ({
50
50
  }}
51
51
  >
52
52
  <Text
53
+ role="button"
53
54
  variant="pS"
54
55
  onClick={() => toggleOpen(true)}
55
56
  onKeyPress={e => e.key === "Enter" && toggleOpen(true)}
@@ -177,7 +177,7 @@ const PaymentFormCard = ({
177
177
  fieldActions={actions.fields.zipCode}
178
178
  showErrors={showErrors}
179
179
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
180
- autocomplete="billing postal-code"
180
+ autoComplete="billing postal-code"
181
181
  />
182
182
  </Box>
183
183
  )}