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

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.17",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -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}