@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/dist/index.cjs.js +16 -28
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +16 -28
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/alert/Alert.js +1 -0
- package/src/components/atoms/checkbox/Checkbox.js +3 -4
- package/src/components/atoms/dropdown/Dropdown.js +0 -1
- package/src/components/atoms/form-layouts/FormInput.js +11 -20
- package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.js +1 -0
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +1 -1
package/package.json
CHANGED
|
@@ -43,7 +43,7 @@ const HiddenCheckbox = styled.input.attrs({ type: "checkbox" })`
|
|
|
43
43
|
width: 1px;
|
|
44
44
|
`;
|
|
45
45
|
|
|
46
|
-
const StyledCheckbox = styled.
|
|
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"
|
|
@@ -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={
|
|
205
|
-
labelTextWhenNoError
|
|
206
|
-
|
|
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
|
-
|
|
223
|
+
autoComplete={autocomplete}
|
|
234
224
|
{...props}
|
|
235
225
|
/>
|
|
236
226
|
) : (
|
|
237
227
|
<InputField
|
|
238
228
|
aria-labelledby={createIdFromString(labelTextWhenNoError)}
|
|
239
|
-
aria-describedby={
|
|
240
|
-
labelTextWhenNoError
|
|
241
|
-
|
|
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}
|
|
@@ -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
|
-
|
|
180
|
+
autoComplete="billing postal-code"
|
|
181
181
|
/>
|
|
182
182
|
</Box>
|
|
183
183
|
)}
|