@thecb/components 9.2.1-beta.0 → 9.2.2-beta.0
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 +38 -95
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +38 -95
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/checkbox/Checkbox.js +1 -3
- package/src/components/atoms/checkbox/Checkbox.stories.js +2 -3
- package/src/components/atoms/country-dropdown/CountryDropdown.js +1 -3
- package/src/components/atoms/country-dropdown/CountryDropdown.stories.js +0 -1
- package/src/components/atoms/dropdown/Dropdown.js +5 -11
- package/src/components/atoms/form-layouts/FormInput.js +0 -3
- package/src/components/atoms/form-select/FormSelect.js +9 -22
- package/src/components/atoms/form-select/FormSelect.stories.js +2 -2
- package/src/components/atoms/radio-button-with-label/RadioButtonWithLabel.js +6 -9
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +1 -4
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.stories.js +0 -1
- package/src/components/molecules/address-form/AddressForm.js +0 -6
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +0 -6
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +0 -6
- package/src/components/molecules/radio-group/RadioGroup.js +1 -1
- package/src/components/molecules/radio-section/RadioSection.js +0 -1
- package/src/components/molecules/radio-section/RadioSection.stories.js +2 -3
- package/src/components/molecules/radio-section/radio-button/RadioButton.js +1 -4
package/package.json
CHANGED
|
@@ -95,8 +95,7 @@ const Checkbox = ({
|
|
|
95
95
|
checkboxMargin = "0 16px 0 0",
|
|
96
96
|
extraStyles,
|
|
97
97
|
textExtraStyles,
|
|
98
|
-
dataQa = null
|
|
99
|
-
isRequired = false
|
|
98
|
+
dataQa = null
|
|
100
99
|
}) => {
|
|
101
100
|
const [focused, setFocused] = useState(false);
|
|
102
101
|
|
|
@@ -143,7 +142,6 @@ const Checkbox = ({
|
|
|
143
142
|
disabledStyles={themeValues.disabledStyles}
|
|
144
143
|
disabledCheckedStyles={themeValues.disabledCheckedStyles}
|
|
145
144
|
focusedStyles={themeValues.focusedStyles}
|
|
146
|
-
aria-required={isRequired}
|
|
147
145
|
>
|
|
148
146
|
<CheckboxIcon
|
|
149
147
|
viewBox="0 0 24 24"
|
|
@@ -13,13 +13,12 @@ const groupId = "props";
|
|
|
13
13
|
export const checkbox = () => (
|
|
14
14
|
<Checkbox
|
|
15
15
|
variant={select(variantsLabel, variants, defaultValue, groupId)}
|
|
16
|
-
title={text("title", "Checkbox
|
|
17
|
-
name={text("name", "Checkbox
|
|
16
|
+
title={text("title", "Checkbox", "props")}
|
|
17
|
+
name={text("name", "Checkbox", "props")}
|
|
18
18
|
checked={boolean("checked", false, "props")}
|
|
19
19
|
error={boolean("error", false, "props")}
|
|
20
20
|
disabled={boolean("disabled", false, "props")}
|
|
21
21
|
focused={boolean("focused", false, "props")}
|
|
22
|
-
isRequired={boolean("isRequired", true, "props")}
|
|
23
22
|
/>
|
|
24
23
|
);
|
|
25
24
|
|
|
@@ -10,8 +10,7 @@ const CountryDropdown = ({
|
|
|
10
10
|
fieldActions,
|
|
11
11
|
showErrors,
|
|
12
12
|
onChange,
|
|
13
|
-
dataQa = null
|
|
14
|
-
isRequired = false
|
|
13
|
+
dataQa = null
|
|
15
14
|
}) => (
|
|
16
15
|
<FormSelect
|
|
17
16
|
options={options}
|
|
@@ -23,7 +22,6 @@ const CountryDropdown = ({
|
|
|
23
22
|
showErrors={showErrors}
|
|
24
23
|
onChange={onChange}
|
|
25
24
|
autocompleteValue="country-name"
|
|
26
|
-
isRequired={isRequired}
|
|
27
25
|
/>
|
|
28
26
|
);
|
|
29
27
|
export default CountryDropdown;
|
|
@@ -133,10 +133,8 @@ const Dropdown = ({
|
|
|
133
133
|
ariaDescribedby,
|
|
134
134
|
autocompleteValue, // browser autofill value, like country-name
|
|
135
135
|
smoothScroll = true,
|
|
136
|
-
ariaInvalid = false
|
|
137
|
-
isRequired = false
|
|
136
|
+
ariaInvalid = false
|
|
138
137
|
}) => {
|
|
139
|
-
const required = options.required || isRequired;
|
|
140
138
|
const [inputValue, setInputValue] = useState("");
|
|
141
139
|
const [optionsState, setOptionsState] = useState([]);
|
|
142
140
|
const [filteredOptions, setFilteredOptions] = useState([]);
|
|
@@ -267,10 +265,8 @@ const Dropdown = ({
|
|
|
267
265
|
setTimer(setTimeout(() => setInputValue(""), 3000));
|
|
268
266
|
}
|
|
269
267
|
setFilteredOptions(
|
|
270
|
-
options.filter(
|
|
271
|
-
option
|
|
272
|
-
option.value.toLowerCase().startsWith(inputValue.toLowerCase()) ||
|
|
273
|
-
option.text.toLowerCase().startsWith(inputValue.toLowerCase())
|
|
268
|
+
options.filter(option =>
|
|
269
|
+
option.value.toLowerCase().match(inputValue.toLowerCase())
|
|
274
270
|
)
|
|
275
271
|
);
|
|
276
272
|
}, [inputValue]);
|
|
@@ -326,7 +322,7 @@ const Dropdown = ({
|
|
|
326
322
|
aria-labelledby={ariaLabelledby}
|
|
327
323
|
aria-describedby={ariaDescribedby}
|
|
328
324
|
aria-expanded={isOpen}
|
|
329
|
-
aria-required={required}
|
|
325
|
+
aria-required={options.required}
|
|
330
326
|
aria-invalid={ariaInvalid}
|
|
331
327
|
background={isOpen ? themeValues.hoverColor : WHITE}
|
|
332
328
|
borderRadius="2px"
|
|
@@ -358,6 +354,7 @@ const Dropdown = ({
|
|
|
358
354
|
}}
|
|
359
355
|
padding="12px"
|
|
360
356
|
placeholder={getSelection()}
|
|
357
|
+
required={options.required}
|
|
361
358
|
role="combobox"
|
|
362
359
|
themeValues={themeValues}
|
|
363
360
|
title={hasTitles ? getSelection() : null}
|
|
@@ -365,8 +362,6 @@ const Dropdown = ({
|
|
|
365
362
|
tabIndex={0}
|
|
366
363
|
value={inputValue}
|
|
367
364
|
width="100%"
|
|
368
|
-
/* Non-semantic elements need the aria-* version of the attribute */
|
|
369
|
-
aria-disabled={disabledValues.includes(inputValue)}
|
|
370
365
|
/>
|
|
371
366
|
<IconWrapper open={isOpen} onClick={onClick}>
|
|
372
367
|
<DropdownIcon />
|
|
@@ -381,7 +376,6 @@ const Dropdown = ({
|
|
|
381
376
|
tabIndex={0}
|
|
382
377
|
role="listbox"
|
|
383
378
|
id={`${ariaLabelledby}_listbox`}
|
|
384
|
-
required={required}
|
|
385
379
|
>
|
|
386
380
|
<Stack childGap="0" as="ul">
|
|
387
381
|
{filteredOptions.map((choice, i) => {
|
|
@@ -116,7 +116,6 @@ const FormInput = ({
|
|
|
116
116
|
extraStyles,
|
|
117
117
|
removeFromValue, // regex of characters to remove before setting value
|
|
118
118
|
dataQa = null,
|
|
119
|
-
isRequired = false,
|
|
120
119
|
...props
|
|
121
120
|
}) => {
|
|
122
121
|
const [showPassword, setShowPassword] = useState(false);
|
|
@@ -222,7 +221,6 @@ const FormInput = ({
|
|
|
222
221
|
$extraStyles={extraStyles}
|
|
223
222
|
data-qa={dataQa || labelTextWhenNoError}
|
|
224
223
|
autoComplete={autocompleteValue}
|
|
225
|
-
required={isRequired}
|
|
226
224
|
{...props}
|
|
227
225
|
/>
|
|
228
226
|
) : (
|
|
@@ -249,7 +247,6 @@ const FormInput = ({
|
|
|
249
247
|
$extraStyles={extraStyles}
|
|
250
248
|
data-qa={dataQa || labelTextWhenNoError}
|
|
251
249
|
autoComplete={autocompleteValue}
|
|
252
|
-
required={isRequired}
|
|
253
250
|
{...props}
|
|
254
251
|
/>
|
|
255
252
|
)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState,
|
|
1
|
+
import React, { useState, useRef, useEffect } from "react";
|
|
2
2
|
import Dropdown from "../dropdown";
|
|
3
3
|
import Text from "../text";
|
|
4
4
|
import { ERROR_COLOR } from "../../../constants/colors";
|
|
@@ -24,25 +24,10 @@ const FormSelect = ({
|
|
|
24
24
|
autocompleteValue, // browser autofill value, like country-name
|
|
25
25
|
smoothScroll = true, // whether the browser should animate scroll to selected item on first open
|
|
26
26
|
dataQa = null,
|
|
27
|
-
widthFitOptions = false
|
|
28
|
-
isRequired = false
|
|
27
|
+
widthFitOptions = false
|
|
29
28
|
}) => {
|
|
30
29
|
const [open, setOpen] = useState(false);
|
|
31
30
|
const dropdownRef = useRef(null);
|
|
32
|
-
const required = options?.required || isRequired;
|
|
33
|
-
|
|
34
|
-
const labelId = useMemo(
|
|
35
|
-
() => labelTextWhenNoError => createIdFromString(labelTextWhenNoError),
|
|
36
|
-
[labelTextWhenNoError]
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
const descriptionId = useMemo(
|
|
40
|
-
() => (field, labelTextWhenNoError) =>
|
|
41
|
-
field.hasErrors && field.dirty
|
|
42
|
-
? labelId(labelTextWhenNoError) + "error-message"
|
|
43
|
-
: "",
|
|
44
|
-
[field, labelTextWhenNoError]
|
|
45
|
-
);
|
|
46
31
|
|
|
47
32
|
const handleClickAway = event => {
|
|
48
33
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
@@ -60,8 +45,8 @@ const FormSelect = ({
|
|
|
60
45
|
return (
|
|
61
46
|
<SelectContainer
|
|
62
47
|
ref={dropdownRef}
|
|
63
|
-
aria-role="group"
|
|
64
48
|
disabled={disabled}
|
|
49
|
+
aria-disabled={disabled}
|
|
65
50
|
data-qa={dataQa}
|
|
66
51
|
>
|
|
67
52
|
<Box padding="0" minWidth="100%">
|
|
@@ -76,15 +61,18 @@ const FormSelect = ({
|
|
|
76
61
|
&::first-letter {
|
|
77
62
|
text-transform: uppercase;
|
|
78
63
|
}`}
|
|
79
|
-
id={
|
|
64
|
+
id={createIdFromString(labelTextWhenNoError)}
|
|
80
65
|
>
|
|
81
66
|
{labelTextWhenNoError}
|
|
82
67
|
</Text>
|
|
83
68
|
</Cluster>
|
|
84
69
|
</Box>
|
|
85
70
|
<Dropdown
|
|
86
|
-
ariaLabelledby={
|
|
87
|
-
ariaDescribedby={
|
|
71
|
+
ariaLabelledby={createIdFromString(labelTextWhenNoError)}
|
|
72
|
+
ariaDescribedby={createIdFromString(
|
|
73
|
+
labelTextWhenNoError,
|
|
74
|
+
"error message"
|
|
75
|
+
)}
|
|
88
76
|
maxHeight={dropdownMaxHeight}
|
|
89
77
|
widthFitOptions={widthFitOptions}
|
|
90
78
|
hasTitles={hasTitles}
|
|
@@ -106,7 +94,6 @@ const FormSelect = ({
|
|
|
106
94
|
disabled={disabled}
|
|
107
95
|
autocompleteValue={autocompleteValue}
|
|
108
96
|
smoothScroll={smoothScroll}
|
|
109
|
-
isRequired={required}
|
|
110
97
|
/>
|
|
111
98
|
<Stack direction="row" justify="space-between">
|
|
112
99
|
<Text
|
|
@@ -12,7 +12,7 @@ const { mapStateToProps, mapDispatchToProps, reducer } = createFormState({
|
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
const errorMessages = {
|
|
15
|
-
[required.error]: "
|
|
15
|
+
[required.error]: "thing is required"
|
|
16
16
|
};
|
|
17
17
|
const options = [
|
|
18
18
|
{ value: "", text: "choose name" },
|
|
@@ -34,7 +34,7 @@ const story = page({
|
|
|
34
34
|
const FormWrapper = props => (
|
|
35
35
|
<FormSelect
|
|
36
36
|
autocompleteValue={props.autocompleteValue}
|
|
37
|
-
labelTextWhenNoError="Form Select
|
|
37
|
+
labelTextWhenNoError="Form Select"
|
|
38
38
|
errorMessages={errorMessages}
|
|
39
39
|
options={options}
|
|
40
40
|
field={props.fields.thing}
|
|
@@ -18,7 +18,7 @@ const Circle = styled.div`
|
|
|
18
18
|
flex-shrink: 0;
|
|
19
19
|
margin-right: 8px;
|
|
20
20
|
width: 1.5rem;
|
|
21
|
-
height
|
|
21
|
+
height 1.5rem;
|
|
22
22
|
border: ${({ inactiveBorderColor }) => `1px solid ${inactiveBorderColor}`};
|
|
23
23
|
border-radius: 50%;
|
|
24
24
|
box-sizing: border-box;
|
|
@@ -30,24 +30,21 @@ const Circle = styled.div`
|
|
|
30
30
|
display: block;
|
|
31
31
|
background: ${({ activeColor }) => activeColor};
|
|
32
32
|
border-radius: 50%;
|
|
33
|
-
transform: scale(0);
|
|
34
|
-
}
|
|
33
|
+
transform: scale(0);
|
|
34
|
+
}
|
|
35
35
|
`;
|
|
36
36
|
|
|
37
37
|
const InputAndLabelContainer = styled(Cluster)`
|
|
38
38
|
overflow: visible;
|
|
39
|
-
|
|
40
39
|
${HiddenRadioInput}:checked + label ${Circle}:after {
|
|
41
40
|
transform: scale(0.85);
|
|
42
41
|
transition: transform 0.15s;
|
|
43
42
|
}
|
|
44
|
-
|
|
45
43
|
${HiddenRadioInput}:checked + label ${Circle} {
|
|
46
|
-
border: ${({ activeColor }) =>
|
|
44
|
+
border: ${({ activeColor }) => `1px solid ${activeColor};`}
|
|
47
45
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
box-shadow: ${({ activeColor }) => "0px 0px 2px 1px " + activeColor};
|
|
46
|
+
${HiddenRadioInput}:focus + label ${Circle} { {
|
|
47
|
+
box-shadow: ${({ activeColor }) => `0px 0px 2px 1px ${activeColor};`}
|
|
51
48
|
}
|
|
52
49
|
`;
|
|
53
50
|
|
|
@@ -9,13 +9,11 @@ const FormStateDropdown = ({
|
|
|
9
9
|
field,
|
|
10
10
|
fieldActions,
|
|
11
11
|
showErrors,
|
|
12
|
-
countryCode
|
|
13
|
-
isRequired = false
|
|
12
|
+
countryCode
|
|
14
13
|
}) => {
|
|
15
14
|
const placeholder =
|
|
16
15
|
countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
|
|
17
16
|
const options = [placeholder, ...getOptions(countryCode)];
|
|
18
|
-
|
|
19
17
|
return (
|
|
20
18
|
<FormSelect
|
|
21
19
|
options={options}
|
|
@@ -25,7 +23,6 @@ const FormStateDropdown = ({
|
|
|
25
23
|
errorMessages={errorMessages}
|
|
26
24
|
showErrors={showErrors}
|
|
27
25
|
autocompleteValue="address-level1"
|
|
28
|
-
isRequired={isRequired}
|
|
29
26
|
/>
|
|
30
27
|
);
|
|
31
28
|
};
|
|
@@ -58,7 +58,6 @@ const AddressForm = ({
|
|
|
58
58
|
labelTextWhenNoError="Country"
|
|
59
59
|
errorMessages={countryErrorMessages}
|
|
60
60
|
field={fields.country}
|
|
61
|
-
isRequired={true}
|
|
62
61
|
onChange={value => {
|
|
63
62
|
actions.fields.country.set(value);
|
|
64
63
|
// temporary measure to not dirty fields until
|
|
@@ -82,7 +81,6 @@ const AddressForm = ({
|
|
|
82
81
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
83
82
|
autocompleteValue="address-line1"
|
|
84
83
|
dataQa="Address"
|
|
85
|
-
isRequired={true}
|
|
86
84
|
/>
|
|
87
85
|
<FormInput
|
|
88
86
|
labelTextWhenNoError="Apt, Suite, Unit, Floor, etc. (Optional)"
|
|
@@ -92,7 +90,6 @@ const AddressForm = ({
|
|
|
92
90
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
93
91
|
autocompleteValue="address-line2"
|
|
94
92
|
dataQa="Address Line 2"
|
|
95
|
-
isRequired={false}
|
|
96
93
|
/>
|
|
97
94
|
<FormInput
|
|
98
95
|
labelTextWhenNoError="City"
|
|
@@ -103,7 +100,6 @@ const AddressForm = ({
|
|
|
103
100
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
104
101
|
autocompleteValue="address-level2"
|
|
105
102
|
dataQa="City"
|
|
106
|
-
isRequired={true}
|
|
107
103
|
/>
|
|
108
104
|
<StateProvinceDropdown
|
|
109
105
|
labelTextWhenNoError={isUS ? "State" : "State or Province"}
|
|
@@ -114,7 +110,6 @@ const AddressForm = ({
|
|
|
114
110
|
showErrors={showErrors}
|
|
115
111
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
116
112
|
dataQa="State or Province"
|
|
117
|
-
isRequired={true}
|
|
118
113
|
/>
|
|
119
114
|
<FormInput
|
|
120
115
|
isNum={isUS}
|
|
@@ -127,7 +122,6 @@ const AddressForm = ({
|
|
|
127
122
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
128
123
|
autocompleteValue="postal-code"
|
|
129
124
|
dataQa="Zip code"
|
|
130
|
-
isRequired={true}
|
|
131
125
|
/>
|
|
132
126
|
{showWalletCheckbox && (
|
|
133
127
|
<Checkbox
|
|
@@ -76,7 +76,6 @@ const PaymentFormACH = ({
|
|
|
76
76
|
showErrors={showErrors}
|
|
77
77
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
78
78
|
autocompleteValue="name"
|
|
79
|
-
isRequired={true}
|
|
80
79
|
/>
|
|
81
80
|
<FormInput
|
|
82
81
|
labelTextWhenNoError="Routing number"
|
|
@@ -98,7 +97,6 @@ const PaymentFormACH = ({
|
|
|
98
97
|
/>
|
|
99
98
|
)}
|
|
100
99
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
101
|
-
isRequired={true}
|
|
102
100
|
/>
|
|
103
101
|
<FormInput
|
|
104
102
|
labelTextWhenNoError="Confirm routing number"
|
|
@@ -108,7 +106,6 @@ const PaymentFormACH = ({
|
|
|
108
106
|
fieldActions={actions.fields.confirmRoutingNumber}
|
|
109
107
|
showErrors={showErrors}
|
|
110
108
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
111
|
-
isRequired={true}
|
|
112
109
|
isNum
|
|
113
110
|
/>
|
|
114
111
|
<FormInput
|
|
@@ -118,7 +115,6 @@ const PaymentFormACH = ({
|
|
|
118
115
|
field={fields.accountNumber}
|
|
119
116
|
fieldActions={actions.fields.accountNumber}
|
|
120
117
|
showErrors={showErrors}
|
|
121
|
-
isRequired={true}
|
|
122
118
|
isNum
|
|
123
119
|
helperModal={() => (
|
|
124
120
|
<AccountAndRoutingModal
|
|
@@ -136,7 +132,6 @@ const PaymentFormACH = ({
|
|
|
136
132
|
<FormInput
|
|
137
133
|
labelTextWhenNoError="Confirm account number"
|
|
138
134
|
dataQa="Confirm account number"
|
|
139
|
-
isRequired={true}
|
|
140
135
|
errorMessages={confirmAccountNumberErrors}
|
|
141
136
|
field={fields.confirmAccountNumber}
|
|
142
137
|
fieldActions={actions.fields.confirmAccountNumber}
|
|
@@ -147,7 +142,6 @@ const PaymentFormACH = ({
|
|
|
147
142
|
{allowBankAccountType && (
|
|
148
143
|
<FormSelect
|
|
149
144
|
labelTextWhenNoError="Account type"
|
|
150
|
-
isRequired={true}
|
|
151
145
|
dataQa="Account type"
|
|
152
146
|
options={[
|
|
153
147
|
{ text: "Select account type", value: "" },
|
|
@@ -98,7 +98,6 @@ const PaymentFormCard = ({
|
|
|
98
98
|
{!hideZipCode && (
|
|
99
99
|
<CountryDropdown
|
|
100
100
|
labelTextWhenNoError="Country"
|
|
101
|
-
isRequired={true}
|
|
102
101
|
errorMessages={countryErrorMessages}
|
|
103
102
|
field={fields.country}
|
|
104
103
|
onChange={value => {
|
|
@@ -122,10 +121,8 @@ const PaymentFormCard = ({
|
|
|
122
121
|
showErrors={showErrors}
|
|
123
122
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
124
123
|
autocompleteValue="cc-name"
|
|
125
|
-
isRequired={true}
|
|
126
124
|
/>
|
|
127
125
|
<FormInput
|
|
128
|
-
isRequired={true}
|
|
129
126
|
labelTextWhenNoError="Credit card number"
|
|
130
127
|
dataQa="Credit card number"
|
|
131
128
|
errorMessages={creditCardNumberErrors}
|
|
@@ -153,7 +150,6 @@ const PaymentFormCard = ({
|
|
|
153
150
|
isNum
|
|
154
151
|
removeFromValue={/\//} // removes "/" from browser autofill
|
|
155
152
|
autocompleteValue="cc-exp"
|
|
156
|
-
isRequired={true}
|
|
157
153
|
/>
|
|
158
154
|
<FormInput
|
|
159
155
|
labelTextWhenNoError="CVV"
|
|
@@ -170,7 +166,6 @@ const PaymentFormCard = ({
|
|
|
170
166
|
}
|
|
171
167
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
172
168
|
autocompleteValue="cc-csc"
|
|
173
|
-
isRequired={true}
|
|
174
169
|
/>
|
|
175
170
|
</FormInputRow>
|
|
176
171
|
{!hideZipCode && (
|
|
@@ -189,7 +184,6 @@ const PaymentFormCard = ({
|
|
|
189
184
|
showErrors={showErrors}
|
|
190
185
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
191
186
|
autocompleteValue="billing postal-code"
|
|
192
|
-
isRequired={true}
|
|
193
187
|
/>
|
|
194
188
|
</Box>
|
|
195
189
|
)}
|
|
@@ -49,10 +49,9 @@ 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
|
|
53
|
-
required: true
|
|
52
|
+
rightIcons: cardIcons
|
|
54
53
|
},
|
|
55
|
-
{ id: "bar", title: "Bar", content: <div>Content 1</div
|
|
54
|
+
{ id: "bar", title: "Bar", content: <div>Content 1</div> },
|
|
56
55
|
{ id: "baz", title: "Baz", content: <div>Content 2</div> }
|
|
57
56
|
];
|
|
58
57
|
|
|
@@ -19,8 +19,7 @@ const RadioButton = ({
|
|
|
19
19
|
ariaDescribedBy = "",
|
|
20
20
|
themeValues,
|
|
21
21
|
ariaLabelledBy = "",
|
|
22
|
-
ariaLabel = null
|
|
23
|
-
required = false
|
|
22
|
+
ariaLabel = null
|
|
24
23
|
}) => {
|
|
25
24
|
const buttonBorder = {
|
|
26
25
|
onFocused: {
|
|
@@ -91,8 +90,6 @@ const RadioButton = ({
|
|
|
91
90
|
type="radio"
|
|
92
91
|
id={`radio-${name}`}
|
|
93
92
|
disabled={disabled}
|
|
94
|
-
required={required}
|
|
95
|
-
aria-required={required}
|
|
96
93
|
onClick={toggleRadio}
|
|
97
94
|
aria-describedby={ariaDescribedBy}
|
|
98
95
|
tabIndex="-1"
|