@thecb/components 9.3.0-beta.2 → 9.3.2-beta.1
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 +753 -631
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +169 -60
- package/dist/index.esm.js +751 -631
- 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 +73 -43
- package/src/components/atoms/dropdown/Dropdown.theme.js +8 -2
- package/src/components/atoms/form-layouts/FormInput.js +0 -4
- package/src/components/atoms/form-select/FormSelect.js +25 -36
- package/src/components/atoms/form-select/FormSelect.stories.js +2 -2
- 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/index.d.ts +1 -0
- package/src/components/molecules/index.js +1 -0
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +0 -7
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +0 -7
- package/src/components/molecules/popover/Popover.js +1 -1
- package/src/components/molecules/radio-section/RadioSection.js +1 -2
- package/src/components/molecules/radio-section/RadioSection.stories.js +2 -3
- package/src/components/molecules/radio-section/radio-button/RadioButton.js +1 -4
- package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV1.js +0 -1
- package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV2.js +1 -2
- package/src/components/molecules/toast-notification/ToastNotification.js +75 -0
- package/src/components/molecules/toast-notification/ToastNotification.stories.js +67 -0
- package/src/components/molecules/toast-notification/index.d.ts +18 -0
- package/src/components/molecules/toast-notification/index.js +3 -0
- package/src/constants/colors.d.ts +1 -0
- package/src/constants/colors.js +5 -1
- package/src/hooks/index.js +3 -0
- package/src/hooks/use-toast-notification/index.d.ts +23 -0
- package/src/hooks/use-toast-notification/index.js +38 -0
- package/src/index.d.ts +2 -1
- package/src/index.js +2 -1
- package/src/types/common/ToastVariants.ts +6 -0
- package/src/types/common/index.ts +1 -0
- package/src/util/index.js +10 -2
- package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +0 -49322
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
- /package/src/{util/useOutsideClick.js → hooks/use-outside-click/index.js} +0 -0
- /package/src/{util/useScrollTo.js → hooks/use-scroll-to/index.js} +0 -0
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;
|
|
@@ -12,11 +12,11 @@ import styled from "styled-components";
|
|
|
12
12
|
import "core-js/proposals/relative-indexing-method";
|
|
13
13
|
|
|
14
14
|
import {
|
|
15
|
-
|
|
15
|
+
ERROR_COLOR,
|
|
16
16
|
GREY_CHATEAU,
|
|
17
|
-
STORM_GREY,
|
|
18
17
|
MINESHAFT_GREY,
|
|
19
|
-
|
|
18
|
+
STORM_GREY,
|
|
19
|
+
WHITE
|
|
20
20
|
} from "../../../constants/colors";
|
|
21
21
|
import { fallbackValues } from "./Dropdown.theme";
|
|
22
22
|
import { themeComponent } from "../../../util/themeUtils";
|
|
@@ -55,37 +55,65 @@ const DropdownContentWrapper = styled.div`
|
|
|
55
55
|
`;
|
|
56
56
|
|
|
57
57
|
const DropdownItemWrapper = styled.li`
|
|
58
|
-
background-color: ${({ selected, themeValues }) =>
|
|
59
|
-
selected ? themeValues.selectedColor : WHITE};
|
|
60
58
|
text-align: start;
|
|
61
|
-
border-width:
|
|
62
|
-
border-
|
|
59
|
+
border-width: 2px;
|
|
60
|
+
border-style: solid;
|
|
61
|
+
border-color: ${({ selected, themeValues }) =>
|
|
62
|
+
selected ? themeValues.selectedColor : WHITE};
|
|
63
63
|
box-shadow: none;
|
|
64
|
-
padding: 1rem;
|
|
65
64
|
box-sizing: border-box;
|
|
66
65
|
width: 100%;
|
|
67
66
|
list-style: none;
|
|
68
67
|
cursor: ${({ disabled }) => (disabled ? "default" : "pointer")};
|
|
69
68
|
|
|
70
69
|
&:hover {
|
|
71
|
-
|
|
70
|
+
border-color: ${({ disabled, selected, themeValues }) =>
|
|
72
71
|
selected
|
|
73
|
-
? themeValues.
|
|
72
|
+
? themeValues.focusColor
|
|
74
73
|
: disabled
|
|
75
74
|
? WHITE
|
|
76
75
|
: themeValues.hoverColor};
|
|
76
|
+
> * {
|
|
77
|
+
background: ${({ selected, disabled, themeValues }) =>
|
|
78
|
+
selected
|
|
79
|
+
? themeValues.focusColor
|
|
80
|
+
: disabled
|
|
81
|
+
? WHITE
|
|
82
|
+
: themeValues.hoverColor};
|
|
83
|
+
border-color: ${({ selected, disabled, themeValues }) =>
|
|
84
|
+
selected
|
|
85
|
+
? themeValues.focusColor
|
|
86
|
+
: disabled
|
|
87
|
+
? WHITE
|
|
88
|
+
: themeValues.hoverColor};
|
|
89
|
+
}
|
|
77
90
|
}
|
|
78
91
|
&:focus {
|
|
79
|
-
background-color: ${({ selected, disabled, themeValues }) =>
|
|
80
|
-
selected
|
|
81
|
-
? themeValues.selectedColor
|
|
82
|
-
: disabled
|
|
83
|
-
? WHITE
|
|
84
|
-
: themeValues.hoverColor};
|
|
85
92
|
outline: none;
|
|
93
|
+
border-color: ${({ themeValues }) => themeValues.selectedColor};
|
|
94
|
+
> * {
|
|
95
|
+
background: ${({ selected, disabled, themeValues }) =>
|
|
96
|
+
selected
|
|
97
|
+
? themeValues.focusColor
|
|
98
|
+
: disabled
|
|
99
|
+
? WHITE
|
|
100
|
+
: themeValues.hoverColor};
|
|
101
|
+
border-color: white;
|
|
102
|
+
outline: none;
|
|
103
|
+
}
|
|
86
104
|
}
|
|
87
105
|
`;
|
|
88
106
|
|
|
107
|
+
const DropdownItemBorder = styled.div`
|
|
108
|
+
background: ${({ selected, themeValues }) =>
|
|
109
|
+
selected ? themeValues.selectedColor : WHITE};
|
|
110
|
+
border-color: ${({ selected, themeValues }) =>
|
|
111
|
+
selected ? themeValues.selectedColor : WHITE};
|
|
112
|
+
border-width: 2px;
|
|
113
|
+
border-style: solid;
|
|
114
|
+
padding: 12px;
|
|
115
|
+
`;
|
|
116
|
+
|
|
89
117
|
const Dropdown = ({
|
|
90
118
|
placeholder,
|
|
91
119
|
options,
|
|
@@ -105,10 +133,8 @@ const Dropdown = ({
|
|
|
105
133
|
ariaDescribedby,
|
|
106
134
|
autocompleteValue, // browser autofill value, like country-name
|
|
107
135
|
smoothScroll = true,
|
|
108
|
-
ariaInvalid = false
|
|
109
|
-
isRequired = false
|
|
136
|
+
ariaInvalid = false
|
|
110
137
|
}) => {
|
|
111
|
-
const required = options.required || isRequired;
|
|
112
138
|
const [inputValue, setInputValue] = useState("");
|
|
113
139
|
const [optionsState, setOptionsState] = useState([]);
|
|
114
140
|
const [filteredOptions, setFilteredOptions] = useState([]);
|
|
@@ -298,8 +324,7 @@ const Dropdown = ({
|
|
|
298
324
|
aria-labelledby={ariaLabelledby}
|
|
299
325
|
aria-describedby={ariaDescribedby}
|
|
300
326
|
aria-expanded={isOpen}
|
|
301
|
-
aria-required={required}
|
|
302
|
-
required={required}
|
|
327
|
+
aria-required={options.required}
|
|
303
328
|
aria-invalid={ariaInvalid}
|
|
304
329
|
background={isOpen ? themeValues.hoverColor : WHITE}
|
|
305
330
|
borderRadius="2px"
|
|
@@ -331,6 +356,7 @@ const Dropdown = ({
|
|
|
331
356
|
}}
|
|
332
357
|
padding="12px"
|
|
333
358
|
placeholder={getSelection()}
|
|
359
|
+
required={options.required}
|
|
334
360
|
role="combobox"
|
|
335
361
|
themeValues={themeValues}
|
|
336
362
|
title={hasTitles ? getSelection() : null}
|
|
@@ -338,7 +364,6 @@ const Dropdown = ({
|
|
|
338
364
|
tabIndex={0}
|
|
339
365
|
value={inputValue}
|
|
340
366
|
width="100%"
|
|
341
|
-
disabled={disabledValues.includes(inputValue)}
|
|
342
367
|
/>
|
|
343
368
|
<IconWrapper open={isOpen} onClick={onClick}>
|
|
344
369
|
<DropdownIcon />
|
|
@@ -353,7 +378,6 @@ const Dropdown = ({
|
|
|
353
378
|
tabIndex={0}
|
|
354
379
|
role="listbox"
|
|
355
380
|
id={`${ariaLabelledby}_listbox`}
|
|
356
|
-
required={required}
|
|
357
381
|
>
|
|
358
382
|
<Stack childGap="0" as="ul">
|
|
359
383
|
{filteredOptions.map((choice, i) => {
|
|
@@ -389,27 +413,33 @@ const Dropdown = ({
|
|
|
389
413
|
role="option"
|
|
390
414
|
onFocus={() => setFocusedRef(optionRefs.current[i])}
|
|
391
415
|
>
|
|
392
|
-
<
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
? WHITE
|
|
397
|
-
: disabledValues.includes(choice.value)
|
|
398
|
-
? STORM_GREY
|
|
399
|
-
: MINESHAFT_GREY
|
|
400
|
-
}
|
|
401
|
-
extraStyles={`padding-left: 16px;
|
|
402
|
-
cursor: ${
|
|
403
|
-
disabledValues.includes(choice.value)
|
|
404
|
-
? "default"
|
|
405
|
-
: "pointer"
|
|
406
|
-
};
|
|
407
|
-
white-space: nowrap;
|
|
408
|
-
overflow: hidden;
|
|
409
|
-
text-overflow: ellipsis;`}
|
|
416
|
+
<DropdownItemBorder
|
|
417
|
+
disabled={disabledValues.includes(choice.value)}
|
|
418
|
+
selected={choice.value === value}
|
|
419
|
+
themeValues={themeValues}
|
|
410
420
|
>
|
|
411
|
-
|
|
412
|
-
|
|
421
|
+
<Text
|
|
422
|
+
variant="p"
|
|
423
|
+
color={
|
|
424
|
+
choice.value === value
|
|
425
|
+
? WHITE
|
|
426
|
+
: disabledValues.includes(choice.value)
|
|
427
|
+
? STORM_GREY
|
|
428
|
+
: MINESHAFT_GREY
|
|
429
|
+
}
|
|
430
|
+
extraStyles={`padding-left: 16px;
|
|
431
|
+
cursor: ${
|
|
432
|
+
disabledValues.includes(choice.value)
|
|
433
|
+
? "default"
|
|
434
|
+
: "pointer"
|
|
435
|
+
};
|
|
436
|
+
white-space: nowrap;
|
|
437
|
+
overflow: hidden;
|
|
438
|
+
text-overflow: ellipsis;`}
|
|
439
|
+
>
|
|
440
|
+
{choice.text}
|
|
441
|
+
</Text>
|
|
442
|
+
</DropdownItemBorder>
|
|
413
443
|
</DropdownItemWrapper>
|
|
414
444
|
);
|
|
415
445
|
})}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
HOVER_LIGHT_BLUE,
|
|
3
|
+
MATISSE_BLUE,
|
|
4
|
+
MATISSE_BLUE_DARK
|
|
5
|
+
} from "../../../constants/colors";
|
|
2
6
|
|
|
3
7
|
const selectedColor = `${MATISSE_BLUE}`;
|
|
4
8
|
const hoverColor = `${HOVER_LIGHT_BLUE}`;
|
|
9
|
+
const focusColor = `${MATISSE_BLUE_DARK}`;
|
|
5
10
|
|
|
6
11
|
export const fallbackValues = {
|
|
7
12
|
selectedColor,
|
|
8
|
-
hoverColor
|
|
13
|
+
hoverColor,
|
|
14
|
+
focusColor
|
|
9
15
|
};
|
|
@@ -116,10 +116,8 @@ 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
|
-
const required = isRequired || props?.required;
|
|
123
121
|
const [showPassword, setShowPassword] = useState(false);
|
|
124
122
|
const { isMobile } = useContext(ThemeContext);
|
|
125
123
|
const setValue = value => {
|
|
@@ -223,7 +221,6 @@ const FormInput = ({
|
|
|
223
221
|
$extraStyles={extraStyles}
|
|
224
222
|
data-qa={dataQa || labelTextWhenNoError}
|
|
225
223
|
autoComplete={autocompleteValue}
|
|
226
|
-
required={required}
|
|
227
224
|
{...props}
|
|
228
225
|
/>
|
|
229
226
|
) : (
|
|
@@ -250,7 +247,6 @@ const FormInput = ({
|
|
|
250
247
|
$extraStyles={extraStyles}
|
|
251
248
|
data-qa={dataQa || labelTextWhenNoError}
|
|
252
249
|
autoComplete={autocompleteValue}
|
|
253
|
-
required={required}
|
|
254
250
|
{...props}
|
|
255
251
|
/>
|
|
256
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,29 +94,30 @@ 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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
99
|
+
{(field.hasErrors && field.dirty) || (field.hasErrors && showErrors) ? (
|
|
100
|
+
<Text
|
|
101
|
+
color={ERROR_COLOR}
|
|
102
|
+
variant="pXS"
|
|
103
|
+
weight={themeValues.fontWeight}
|
|
104
|
+
extraStyles={`
|
|
117
105
|
word-break: break-word;
|
|
118
106
|
font-family: Public Sans;
|
|
119
107
|
&::first-letter {
|
|
120
108
|
text-transform: uppercase;
|
|
121
109
|
}
|
|
122
110
|
`}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
111
|
+
id={createIdFromString(labelTextWhenNoError, "error message")}
|
|
112
|
+
aria-live="polite"
|
|
113
|
+
aria-atomic={true}
|
|
114
|
+
data-qa={createIdFromString(labelTextWhenNoError, "error message")}
|
|
115
|
+
>
|
|
116
|
+
{errorMessages[field.errors[0]]}
|
|
117
|
+
</Text>
|
|
118
|
+
) : (
|
|
119
|
+
<Text extraStyles={`height: ${themeValues.lineHeight};`} />
|
|
120
|
+
)}
|
|
132
121
|
</Stack>
|
|
133
122
|
</SelectContainer>
|
|
134
123
|
);
|
|
@@ -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}
|
|
@@ -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
|
|
@@ -37,5 +37,6 @@ export { default as TabSidebar } from "./tab-sidebar";
|
|
|
37
37
|
export { default as TermsAndConditions } from "./terms-and-conditions";
|
|
38
38
|
export { default as TermsAndConditionsModal } from "./terms-and-conditions-modal";
|
|
39
39
|
export { default as Timeout } from "./timeout";
|
|
40
|
+
export { default as ToastNotification } from "./toast-notification";
|
|
40
41
|
export { default as WelcomeModule } from "./welcome-module";
|
|
41
42
|
export { default as WorkflowTile } from "./workflow-tile";
|
|
@@ -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: "" },
|
|
@@ -188,7 +182,6 @@ const PaymentFormACH = ({
|
|
|
188
182
|
showCheckbox={false}
|
|
189
183
|
description="View"
|
|
190
184
|
terms={termsContent}
|
|
191
|
-
isRequired={true}
|
|
192
185
|
/>
|
|
193
186
|
</Cover>
|
|
194
187
|
)}
|
|
@@ -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,7 +121,6 @@ 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
126
|
labelTextWhenNoError="Credit card number"
|
|
@@ -135,7 +133,6 @@ const PaymentFormCard = ({
|
|
|
135
133
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
136
134
|
isNum
|
|
137
135
|
autocompleteValue="cc-number"
|
|
138
|
-
isRequired={true}
|
|
139
136
|
/>
|
|
140
137
|
<FormInputRow
|
|
141
138
|
breakpoint={isMobile ? "1000rem" : "21rem"}
|
|
@@ -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
|
)}
|
|
@@ -211,7 +205,6 @@ const PaymentFormCard = ({
|
|
|
211
205
|
showCheckbox={false}
|
|
212
206
|
description="View"
|
|
213
207
|
terms={termsContent}
|
|
214
|
-
isRequired={true}
|
|
215
208
|
/>
|
|
216
209
|
</Cover>
|
|
217
210
|
)}
|
|
@@ -4,7 +4,7 @@ import Text from "../../atoms/text";
|
|
|
4
4
|
import Paragraph from "../../atoms/paragraph";
|
|
5
5
|
import { Box } from "../../atoms/layouts";
|
|
6
6
|
import ButtonWithAction from "../../atoms/button-with-action";
|
|
7
|
-
import { useOutsideClick } from "../../../
|
|
7
|
+
import { useOutsideClick } from "../../../hooks";
|
|
8
8
|
import { noop } from "../../../util/general";
|
|
9
9
|
import { fallbackValues } from "./Popover.theme";
|
|
10
10
|
|
|
@@ -177,7 +177,6 @@ const RadioSection = ({
|
|
|
177
177
|
: () => toggleOpenSection(section.id)
|
|
178
178
|
}
|
|
179
179
|
tabIndex="-1"
|
|
180
|
-
required={section?.required}
|
|
181
180
|
/>
|
|
182
181
|
</Box>
|
|
183
182
|
)}
|
|
@@ -198,7 +197,7 @@ const RadioSection = ({
|
|
|
198
197
|
<Cluster
|
|
199
198
|
childGap="0.5rem"
|
|
200
199
|
aria-label={section?.rightIconsLabel || null}
|
|
201
|
-
role={section?.rightIconsRole ||
|
|
200
|
+
role={section?.rightIconsRole || null}
|
|
202
201
|
>
|
|
203
202
|
{section.rightIcons.map(icon => (
|
|
204
203
|
<RightIcon
|