@thecb/components 6.1.2 → 6.1.4-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/README.md +14 -7
- package/dist/index.cjs.js +101 -40
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +101 -40
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/.DS_Store +0 -0
- package/src/components/atoms/form-layouts/FormInput.js +3 -0
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +3 -2
- package/src/components/molecules/address-form/AddressForm.js +5 -0
- package/src/components/molecules/change-password-form/ChangePasswordForm.js +3 -0
- package/src/components/molecules/edit-name-form/EditNameForm.js +2 -0
- package/src/components/molecules/editable-list/EditableList.js +4 -3
- package/src/components/molecules/email-form/EmailForm.js +1 -0
- package/src/components/molecules/forgot-password-form/ForgotPasswordForm.js +1 -0
- package/src/components/molecules/internal-user-info-form/InternalUserInfoForm.js +3 -0
- package/src/components/molecules/login-form/LoginForm.js +2 -0
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +1 -0
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +5 -0
- package/src/components/molecules/payment-form-card/PaymentFormCard.state.js +3 -2
- package/src/components/molecules/phone-form/PhoneForm.js +1 -0
- package/src/components/molecules/registration-form/RegistrationForm.js +5 -0
- package/src/components/molecules/reset-password-form/ResetPasswordForm.js +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thecb/components",
|
|
3
|
-
"version": "6.1.2",
|
|
3
|
+
"version": "6.1.4-beta.2",
|
|
4
4
|
"description": "Common lib for CityBase react components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -86,6 +86,6 @@
|
|
|
86
86
|
"ramda": "^0.27.0",
|
|
87
87
|
"react-aria-modal": "^4.0.0",
|
|
88
88
|
"react-pose": "^4.0.10",
|
|
89
|
-
"redux-freeform": "^5.
|
|
89
|
+
"redux-freeform": "^5.6.0-beta.3"
|
|
90
90
|
}
|
|
91
91
|
}
|
package/src/.DS_Store
ADDED
|
Binary file
|
|
@@ -112,6 +112,7 @@ const FormInput = ({
|
|
|
112
112
|
themeValues,
|
|
113
113
|
background,
|
|
114
114
|
customHeight,
|
|
115
|
+
autocomplete,
|
|
115
116
|
extraStyles,
|
|
116
117
|
...props
|
|
117
118
|
}) => {
|
|
@@ -210,6 +211,7 @@ const FormInput = ({
|
|
|
210
211
|
themeValues={themeValues}
|
|
211
212
|
$customHeight={customHeight}
|
|
212
213
|
$extraStyles={extraStyles}
|
|
214
|
+
autocomplete={autocomplete}
|
|
213
215
|
{...props}
|
|
214
216
|
/>
|
|
215
217
|
) : (
|
|
@@ -235,6 +237,7 @@ const FormInput = ({
|
|
|
235
237
|
background={background}
|
|
236
238
|
$customHeight={customHeight}
|
|
237
239
|
$extraStyles={extraStyles}
|
|
240
|
+
autocomplete={autocomplete}
|
|
238
241
|
{...props}
|
|
239
242
|
/>
|
|
240
243
|
)}
|
|
@@ -9,7 +9,8 @@ const FormStateDropdown = ({
|
|
|
9
9
|
field,
|
|
10
10
|
fieldActions,
|
|
11
11
|
showErrors,
|
|
12
|
-
countryCode
|
|
12
|
+
countryCode,
|
|
13
|
+
autocomplete
|
|
13
14
|
}) => {
|
|
14
15
|
const placeholder =
|
|
15
16
|
countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
|
|
@@ -22,7 +23,7 @@ const FormStateDropdown = ({
|
|
|
22
23
|
labelTextWhenNoError={labelTextWhenNoError}
|
|
23
24
|
errorMessages={errorMessages}
|
|
24
25
|
showErrors={showErrors}
|
|
25
|
-
autocompleteValue=
|
|
26
|
+
autocompleteValue={autocomplete}
|
|
26
27
|
/>
|
|
27
28
|
);
|
|
28
29
|
};
|
|
@@ -72,6 +72,7 @@ const AddressForm = ({
|
|
|
72
72
|
fieldActions={actions.fields.street1}
|
|
73
73
|
showErrors={showErrors}
|
|
74
74
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
75
|
+
autocomplete="address-line1"
|
|
75
76
|
/>
|
|
76
77
|
<FormInput
|
|
77
78
|
labelTextWhenNoError="Apt, Suite, Unit, Floor, etc. (Optional)"
|
|
@@ -79,6 +80,7 @@ const AddressForm = ({
|
|
|
79
80
|
fieldActions={actions.fields.street2}
|
|
80
81
|
showErrors={showErrors}
|
|
81
82
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
83
|
+
autocomplete="address-line2"
|
|
82
84
|
/>
|
|
83
85
|
<FormInput
|
|
84
86
|
labelTextWhenNoError="City"
|
|
@@ -87,6 +89,7 @@ const AddressForm = ({
|
|
|
87
89
|
fieldActions={actions.fields.city}
|
|
88
90
|
showErrors={showErrors}
|
|
89
91
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
92
|
+
autocomplete="address-level2"
|
|
90
93
|
/>
|
|
91
94
|
<StateProvinceDropdown
|
|
92
95
|
labelTextWhenNoError={isUS ? "State" : "State or Province"}
|
|
@@ -96,6 +99,7 @@ const AddressForm = ({
|
|
|
96
99
|
fieldActions={actions.fields.stateProvince}
|
|
97
100
|
showErrors={showErrors}
|
|
98
101
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
102
|
+
autocomplete="address-level1"
|
|
99
103
|
/>
|
|
100
104
|
<FormInput
|
|
101
105
|
isNum={isUS}
|
|
@@ -106,6 +110,7 @@ const AddressForm = ({
|
|
|
106
110
|
fieldActions={actions.fields.zip}
|
|
107
111
|
showErrors={showErrors}
|
|
108
112
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
113
|
+
autocomplete="postal-code"
|
|
109
114
|
/>
|
|
110
115
|
{showWalletCheckbox && (
|
|
111
116
|
<Checkbox
|
|
@@ -91,6 +91,7 @@ const ChangePasswordForm = ({
|
|
|
91
91
|
showErrors={showErrors}
|
|
92
92
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
93
93
|
type="password"
|
|
94
|
+
autocomplete="current-password"
|
|
94
95
|
/>
|
|
95
96
|
<FormInput
|
|
96
97
|
labelTextWhenNoError="New password"
|
|
@@ -100,6 +101,7 @@ const ChangePasswordForm = ({
|
|
|
100
101
|
showErrors={showErrors}
|
|
101
102
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
102
103
|
type="password"
|
|
104
|
+
autocomplete="new-password"
|
|
103
105
|
/>
|
|
104
106
|
<FormInput
|
|
105
107
|
labelTextWhenNoError="Confirm password"
|
|
@@ -109,6 +111,7 @@ const ChangePasswordForm = ({
|
|
|
109
111
|
showErrors={showErrors}
|
|
110
112
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
111
113
|
type="password"
|
|
114
|
+
autocomplete="new-password"
|
|
112
115
|
/>
|
|
113
116
|
</FormInputColumn>
|
|
114
117
|
<Box padding={isMobile ? "1rem 0 0" : "1.5rem 0 0"}>
|
|
@@ -35,6 +35,7 @@ const EditNameForm = ({
|
|
|
35
35
|
fieldActions={actions.fields.firstName}
|
|
36
36
|
showErrors={showErrors}
|
|
37
37
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
38
|
+
autocomplete="given-name"
|
|
38
39
|
/>
|
|
39
40
|
<FormInput
|
|
40
41
|
labelTextWhenNoError="Last Name"
|
|
@@ -43,6 +44,7 @@ const EditNameForm = ({
|
|
|
43
44
|
fieldActions={actions.fields.lastName}
|
|
44
45
|
showErrors={showErrors}
|
|
45
46
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
47
|
+
autocomplete="family-name"
|
|
46
48
|
/>
|
|
47
49
|
</FormInputColumn>
|
|
48
50
|
</FormContainer>
|
|
@@ -36,7 +36,8 @@ const EditableList = ({
|
|
|
36
36
|
modalProps,
|
|
37
37
|
autoPayMethods,
|
|
38
38
|
as = "p",
|
|
39
|
-
qaPrefix
|
|
39
|
+
qaPrefix,
|
|
40
|
+
ariaLabel
|
|
40
41
|
}) => {
|
|
41
42
|
const addText = `Add a${
|
|
42
43
|
itemName[0].match(/[aieouAIEOU]/) ? "n" : ""
|
|
@@ -111,7 +112,7 @@ const EditableList = ({
|
|
|
111
112
|
text="Remove"
|
|
112
113
|
action={() => removeItem(item.id)}
|
|
113
114
|
extraStyles={`min-width: 0;`}
|
|
114
|
-
aria-label={`Remove ${itemName}`}
|
|
115
|
+
aria-label={`Remove ${ariaLabel || itemName}`}
|
|
115
116
|
/>
|
|
116
117
|
)}
|
|
117
118
|
</Box>
|
|
@@ -129,7 +130,7 @@ const EditableList = ({
|
|
|
129
130
|
text="Edit"
|
|
130
131
|
action={() => editItem(item.id)}
|
|
131
132
|
extraStyles={`min-width: 0;`}
|
|
132
|
-
aria-label={`Edit ${itemName}`}
|
|
133
|
+
aria-label={`Edit ${ariaLabel || itemName}`}
|
|
133
134
|
/>
|
|
134
135
|
</Box>
|
|
135
136
|
)}
|
|
@@ -152,6 +152,7 @@ const InternalUserInfoForm = ({
|
|
|
152
152
|
showErrors={showErrors}
|
|
153
153
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
154
154
|
disabled={namesDisabled}
|
|
155
|
+
autocomplete="given-name"
|
|
155
156
|
/>
|
|
156
157
|
<FormInput
|
|
157
158
|
labelTextWhenNoError="Last Name"
|
|
@@ -161,6 +162,7 @@ const InternalUserInfoForm = ({
|
|
|
161
162
|
showErrors={showErrors}
|
|
162
163
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
163
164
|
disabled={namesDisabled}
|
|
165
|
+
autocomplete="family-name"
|
|
164
166
|
/>
|
|
165
167
|
<FormInput
|
|
166
168
|
labelTextWhenNoError="Email"
|
|
@@ -170,6 +172,7 @@ const InternalUserInfoForm = ({
|
|
|
170
172
|
showErrors={showErrors}
|
|
171
173
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
172
174
|
disabled={emailDisabled}
|
|
175
|
+
autocomplete="email"
|
|
173
176
|
/>
|
|
174
177
|
{formType === PROFILE && (
|
|
175
178
|
<FormInput
|
|
@@ -31,6 +31,7 @@ const LoginForm = ({
|
|
|
31
31
|
showErrors={showErrors}
|
|
32
32
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
33
33
|
isEmail
|
|
34
|
+
autocomplete="email"
|
|
34
35
|
/>
|
|
35
36
|
<FormInput
|
|
36
37
|
labelTextWhenNoError="Password"
|
|
@@ -40,6 +41,7 @@ const LoginForm = ({
|
|
|
40
41
|
fieldActions={actions.fields.password}
|
|
41
42
|
showErrors={showErrors}
|
|
42
43
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
44
|
+
autocomplete="current-password"
|
|
43
45
|
/>
|
|
44
46
|
</FormInputColumn>
|
|
45
47
|
);
|
|
@@ -114,6 +114,7 @@ const PaymentFormCard = ({
|
|
|
114
114
|
fieldActions={actions.fields.nameOnCard}
|
|
115
115
|
showErrors={showErrors}
|
|
116
116
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
117
|
+
autocomplete="cc-name"
|
|
117
118
|
/>
|
|
118
119
|
<FormInput
|
|
119
120
|
labelTextWhenNoError="Credit card number"
|
|
@@ -124,6 +125,7 @@ const PaymentFormCard = ({
|
|
|
124
125
|
formatter={creditCardFormat}
|
|
125
126
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
126
127
|
isNum
|
|
128
|
+
autocomplete="cc-number"
|
|
127
129
|
/>
|
|
128
130
|
<FormInputRow
|
|
129
131
|
breakpoint={isMobile ? "1000rem" : "21rem"}
|
|
@@ -138,6 +140,7 @@ const PaymentFormCard = ({
|
|
|
138
140
|
formatter={expirationDateFormat}
|
|
139
141
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
140
142
|
isNum
|
|
143
|
+
autocomplete="cc-exp"
|
|
141
144
|
/>
|
|
142
145
|
<FormInput
|
|
143
146
|
labelTextWhenNoError="CVV"
|
|
@@ -152,6 +155,7 @@ const PaymentFormCard = ({
|
|
|
152
155
|
: "/CVVHint.svg"
|
|
153
156
|
}
|
|
154
157
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
158
|
+
autocomplete="cc-csc"
|
|
155
159
|
/>
|
|
156
160
|
</FormInputRow>
|
|
157
161
|
{!hideZipCode && (
|
|
@@ -168,6 +172,7 @@ const PaymentFormCard = ({
|
|
|
168
172
|
fieldActions={actions.fields.zipCode}
|
|
169
173
|
showErrors={showErrors}
|
|
170
174
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
175
|
+
autocomplete="billing postal-code"
|
|
171
176
|
/>
|
|
172
177
|
</Box>
|
|
173
178
|
)}
|
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
matchesRegex,
|
|
7
7
|
validateWhen,
|
|
8
8
|
dateAfterToday,
|
|
9
|
-
isValidMonth
|
|
9
|
+
isValidMonth,
|
|
10
|
+
onlyExpirationDate
|
|
10
11
|
} from "redux-freeform";
|
|
11
12
|
|
|
12
13
|
//TODO: Will make zip code able to have more than 5 digits once we add in the FormattedInput because it will have issues with format of 60606-1111.
|
|
@@ -30,7 +31,7 @@ const formConfig = {
|
|
|
30
31
|
isValidMonth(0),
|
|
31
32
|
dateAfterToday("MMYY", "month", true)
|
|
32
33
|
],
|
|
33
|
-
constraints: [
|
|
34
|
+
constraints: [onlyExpirationDate(), hasLength(0, 4)]
|
|
34
35
|
},
|
|
35
36
|
cvv: {
|
|
36
37
|
validators: [required(), hasLength(3, 4)],
|
|
@@ -59,6 +59,7 @@ const RegistrationForm = ({
|
|
|
59
59
|
fieldActions={actions.fields.firstName}
|
|
60
60
|
showErrors={showErrors}
|
|
61
61
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
62
|
+
autocomplete="given-name"
|
|
62
63
|
/>
|
|
63
64
|
<FormInput
|
|
64
65
|
labelTextWhenNoError="Last name"
|
|
@@ -67,6 +68,7 @@ const RegistrationForm = ({
|
|
|
67
68
|
fieldActions={actions.fields.lastName}
|
|
68
69
|
showErrors={showErrors}
|
|
69
70
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
71
|
+
autocomplete="family-name"
|
|
70
72
|
/>
|
|
71
73
|
<FormInput
|
|
72
74
|
labelTextWhenNoError="Email address"
|
|
@@ -77,6 +79,7 @@ const RegistrationForm = ({
|
|
|
77
79
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
78
80
|
type="email"
|
|
79
81
|
isEmail
|
|
82
|
+
autocomplete="email"
|
|
80
83
|
/>
|
|
81
84
|
<FormInput
|
|
82
85
|
labelTextWhenNoError="Password"
|
|
@@ -86,6 +89,7 @@ const RegistrationForm = ({
|
|
|
86
89
|
showErrors={showErrors}
|
|
87
90
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
88
91
|
type="password"
|
|
92
|
+
autocomplete="new-password"
|
|
89
93
|
/>
|
|
90
94
|
<FormInput
|
|
91
95
|
labelTextWhenNoError="Confirm password"
|
|
@@ -95,6 +99,7 @@ const RegistrationForm = ({
|
|
|
95
99
|
showErrors={showErrors}
|
|
96
100
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
97
101
|
type="password"
|
|
102
|
+
autocomplete="new-password"
|
|
98
103
|
/>
|
|
99
104
|
<Box padding={isMobile ? "0" : "0.5rem 0 0"}>
|
|
100
105
|
<PasswordRequirements password={fields.password} isMobile={isMobile} />
|
|
@@ -49,6 +49,7 @@ const ResetPasswordForm = ({
|
|
|
49
49
|
showErrors={showErrors}
|
|
50
50
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
51
51
|
type="password"
|
|
52
|
+
autocomplete="new-password"
|
|
52
53
|
/>
|
|
53
54
|
<FormInput
|
|
54
55
|
labelTextWhenNoError="Confirm password"
|
|
@@ -58,6 +59,7 @@ const ResetPasswordForm = ({
|
|
|
58
59
|
showErrors={showErrors}
|
|
59
60
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
60
61
|
type="password"
|
|
62
|
+
autocomplete="new-password"
|
|
61
63
|
/>
|
|
62
64
|
<Box padding="0">
|
|
63
65
|
<PasswordRequirements password={fields.password} isMobile={isMobile} />
|