@thecb/components 9.3.1-beta.0 → 9.3.1-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.
Files changed (50) hide show
  1. package/dist/index.cjs.js +795 -468
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +169 -60
  4. package/dist/index.esm.js +793 -468
  5. package/dist/index.esm.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/components/atoms/checkbox/Checkbox.js +8 -1
  8. package/src/components/atoms/checkbox/Checkbox.stories.js +1 -0
  9. package/src/components/atoms/country-dropdown/CountryDropdown.js +2 -0
  10. package/src/components/atoms/dropdown/Dropdown.js +78 -41
  11. package/src/components/atoms/dropdown/Dropdown.theme.js +8 -2
  12. package/src/components/atoms/form-layouts/FormInput.js +3 -0
  13. package/src/components/atoms/form-select/FormSelect.js +19 -15
  14. package/src/components/atoms/icons/AccountNumberImage.js +2 -0
  15. package/src/components/atoms/icons/BankIcon.js +2 -0
  16. package/src/components/atoms/icons/CheckmarkIcon.js +2 -0
  17. package/src/components/atoms/icons/GenericCard.js +2 -0
  18. package/src/components/atoms/icons/GenericCardLarge.js +2 -0
  19. package/src/components/atoms/icons/RoutingNumberImage.js +2 -0
  20. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +3 -1
  21. package/src/components/molecules/address-form/AddressForm.js +5 -0
  22. package/src/components/molecules/email-form/EmailForm.js +3 -1
  23. package/src/components/molecules/index.d.ts +1 -0
  24. package/src/components/molecules/index.js +1 -0
  25. package/src/components/molecules/modal/Modal.js +2 -1
  26. package/src/components/molecules/payment-form-ach/PaymentFormACH.js +6 -0
  27. package/src/components/molecules/payment-form-card/PaymentFormCard.js +5 -0
  28. package/src/components/molecules/phone-form/PhoneForm.js +3 -1
  29. package/src/components/molecules/popover/Popover.js +1 -1
  30. package/src/components/molecules/radio-section/RadioSection.js +313 -124
  31. package/src/components/molecules/radio-section/RadioSection.stories.js +45 -10
  32. package/src/components/molecules/radio-section/radio-button/RadioButton.js +3 -1
  33. package/src/components/molecules/terms-and-conditions/TermsAndConditions.stories.js +3 -1
  34. package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV2.js +5 -1
  35. package/src/components/molecules/toast-notification/ToastNotification.js +75 -0
  36. package/src/components/molecules/toast-notification/ToastNotification.stories.js +67 -0
  37. package/src/components/molecules/toast-notification/index.d.ts +18 -0
  38. package/src/components/molecules/toast-notification/index.js +3 -0
  39. package/src/constants/colors.d.ts +1 -0
  40. package/src/constants/colors.js +5 -1
  41. package/src/hooks/index.js +3 -0
  42. package/src/hooks/use-toast-notification/index.d.ts +23 -0
  43. package/src/hooks/use-toast-notification/index.js +38 -0
  44. package/src/index.d.ts +2 -1
  45. package/src/index.js +2 -1
  46. package/src/types/common/ToastVariants.ts +6 -0
  47. package/src/types/common/index.ts +1 -0
  48. package/src/util/index.js +10 -2
  49. /package/src/{util/useOutsideClick.js → hooks/use-outside-click/index.js} +0 -0
  50. /package/src/{util/useScrollTo.js → hooks/use-scroll-to/index.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "9.3.1-beta.0",
3
+ "version": "9.3.1-beta.2",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -95,6 +95,7 @@ const Checkbox = ({
95
95
  checkboxMargin = "0 16px 0 0",
96
96
  extraStyles,
97
97
  textExtraStyles,
98
+ labelledById,
98
99
  dataQa = null
99
100
  }) => {
100
101
  const [focused, setFocused] = useState(false);
@@ -105,6 +106,10 @@ const Checkbox = ({
105
106
  }
106
107
  };
107
108
 
109
+ const titleId = title ? `checkboxlabel-${name}` : undefined;
110
+ const ariaLabelledById = labelledById ?? titleId;
111
+ const ariaLabel = ariaLabelledById ? undefined : name;
112
+
108
113
  return (
109
114
  <Box
110
115
  padding="0"
@@ -122,7 +127,8 @@ const Checkbox = ({
122
127
  id={`checkbox-${name}`}
123
128
  disabled={disabled}
124
129
  name={name}
125
- aria-label={name}
130
+ aria-label={ariaLabel}
131
+ aria-labelledby={ariaLabelledById}
126
132
  checked={checked}
127
133
  onChange={onChange}
128
134
  tabIndex="-1"
@@ -155,6 +161,7 @@ const Checkbox = ({
155
161
  </CheckboxContainer>
156
162
  {title && (
157
163
  <Text
164
+ id={titleId}
158
165
  variant="p"
159
166
  weight={themeValues.textFontWeight}
160
167
  color={themeValues.textColor}
@@ -19,6 +19,7 @@ export const checkbox = () => (
19
19
  error={boolean("error", false, "props")}
20
20
  disabled={boolean("disabled", false, "props")}
21
21
  focused={boolean("focused", false, "props")}
22
+ labelledById={text("labelledById", undefined, "props")}
22
23
  />
23
24
  );
24
25
 
@@ -10,6 +10,7 @@ const CountryDropdown = ({
10
10
  fieldActions,
11
11
  showErrors,
12
12
  onChange,
13
+ isRequired = false,
13
14
  dataQa = null
14
15
  }) => (
15
16
  <FormSelect
@@ -22,6 +23,7 @@ const CountryDropdown = ({
22
23
  showErrors={showErrors}
23
24
  onChange={onChange}
24
25
  autocompleteValue="country-name"
26
+ isRequired={isRequired}
25
27
  />
26
28
  );
27
29
  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
- WHITE,
15
+ ERROR_COLOR,
16
16
  GREY_CHATEAU,
17
- STORM_GREY,
18
17
  MINESHAFT_GREY,
19
- ERROR_COLOR
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: 0px;
62
- border-color: transparent;
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
- background-color: ${({ selected, disabled, themeValues }) =>
70
+ border-color: ${({ disabled, selected, themeValues }) =>
72
71
  selected
73
- ? themeValues.selectedColor
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,7 +133,8 @@ const Dropdown = ({
105
133
  ariaDescribedby,
106
134
  autocompleteValue, // browser autofill value, like country-name
107
135
  smoothScroll = true,
108
- ariaInvalid = false
136
+ ariaInvalid = false,
137
+ isRequired = false
109
138
  }) => {
110
139
  const [inputValue, setInputValue] = useState("");
111
140
  const [optionsState, setOptionsState] = useState([]);
@@ -234,13 +263,15 @@ const Dropdown = ({
234
263
  useEffect(() => {
235
264
  if (autoEraseTypeAhead) {
236
265
  clearTimeout(timer);
237
- setTimer(setTimeout(() => setInputValue(""), 3000));
266
+ setTimer(setTimeout(() => setInputValue(""), 20000));
238
267
  }
268
+
239
269
  setFilteredOptions(
240
270
  options.filter(
241
271
  option =>
242
- option.value.toLowerCase().startsWith(inputValue.toLowerCase()) ||
243
- option.text.toLowerCase().startsWith(inputValue.toLowerCase())
272
+ option?.value?.toLowerCase()?.indexOf(inputValue?.toLowerCase()) >=
273
+ 0 ||
274
+ option.text?.toLowerCase()?.indexOf(inputValue?.toLowerCase()) >= 0
244
275
  )
245
276
  );
246
277
  }, [inputValue]);
@@ -328,7 +359,7 @@ const Dropdown = ({
328
359
  }}
329
360
  padding="12px"
330
361
  placeholder={getSelection()}
331
- required={options.required}
362
+ required={options.required || isRequired}
332
363
  role="combobox"
333
364
  themeValues={themeValues}
334
365
  title={hasTitles ? getSelection() : null}
@@ -385,27 +416,33 @@ const Dropdown = ({
385
416
  role="option"
386
417
  onFocus={() => setFocusedRef(optionRefs.current[i])}
387
418
  >
388
- <Text
389
- variant="p"
390
- color={
391
- choice.value === value
392
- ? WHITE
393
- : disabledValues.includes(choice.value)
394
- ? STORM_GREY
395
- : MINESHAFT_GREY
396
- }
397
- extraStyles={`padding-left: 16px;
398
- cursor: ${
399
- disabledValues.includes(choice.value)
400
- ? "default"
401
- : "pointer"
402
- };
403
- white-space: nowrap;
404
- overflow: hidden;
405
- text-overflow: ellipsis;`}
419
+ <DropdownItemBorder
420
+ disabled={disabledValues.includes(choice.value)}
421
+ selected={choice.value === value}
422
+ themeValues={themeValues}
406
423
  >
407
- {choice.text}
408
- </Text>
424
+ <Text
425
+ variant="p"
426
+ color={
427
+ choice.value === value
428
+ ? WHITE
429
+ : disabledValues.includes(choice.value)
430
+ ? STORM_GREY
431
+ : MINESHAFT_GREY
432
+ }
433
+ extraStyles={`padding-left: 16px;
434
+ cursor: ${
435
+ disabledValues.includes(choice.value)
436
+ ? "default"
437
+ : "pointer"
438
+ };
439
+ white-space: nowrap;
440
+ overflow: hidden;
441
+ text-overflow: ellipsis;`}
442
+ >
443
+ {choice.text}
444
+ </Text>
445
+ </DropdownItemBorder>
409
446
  </DropdownItemWrapper>
410
447
  );
411
448
  })}
@@ -1,9 +1,15 @@
1
- import { HOVER_LIGHT_BLUE, MATISSE_BLUE } from "../../../constants/colors";
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,6 +116,7 @@ const FormInput = ({
116
116
  extraStyles,
117
117
  removeFromValue, // regex of characters to remove before setting value
118
118
  dataQa = null,
119
+ isRequired = false,
119
120
  ...props
120
121
  }) => {
121
122
  const [showPassword, setShowPassword] = useState(false);
@@ -221,6 +222,7 @@ const FormInput = ({
221
222
  $extraStyles={extraStyles}
222
223
  data-qa={dataQa || labelTextWhenNoError}
223
224
  autoComplete={autocompleteValue}
225
+ required={isRequired}
224
226
  {...props}
225
227
  />
226
228
  ) : (
@@ -247,6 +249,7 @@ const FormInput = ({
247
249
  $extraStyles={extraStyles}
248
250
  data-qa={dataQa || labelTextWhenNoError}
249
251
  autoComplete={autocompleteValue}
252
+ required={isRequired}
250
253
  {...props}
251
254
  />
252
255
  )}
@@ -24,7 +24,8 @@ 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
27
+ widthFitOptions = false,
28
+ isRequired = false
28
29
  }) => {
29
30
  const [open, setOpen] = useState(false);
30
31
  const dropdownRef = useRef(null);
@@ -94,28 +95,31 @@ const FormSelect = ({
94
95
  disabled={disabled}
95
96
  autocompleteValue={autocompleteValue}
96
97
  smoothScroll={smoothScroll}
98
+ isRequired={isRequired}
97
99
  />
98
100
  <Stack direction="row" justify="space-between">
99
- <Text
100
- color={ERROR_COLOR}
101
- variant="pXS"
102
- weight={themeValues.fontWeight}
103
- extraStyles={`
101
+ {(field.hasErrors && field.dirty) || (field.hasErrors && showErrors) ? (
102
+ <Text
103
+ color={ERROR_COLOR}
104
+ variant="pXS"
105
+ weight={themeValues.fontWeight}
106
+ extraStyles={`
104
107
  word-break: break-word;
105
108
  font-family: Public Sans;
106
109
  &::first-letter {
107
110
  text-transform: uppercase;
108
111
  }
109
112
  `}
110
- id={createIdFromString(labelTextWhenNoError, "error message")}
111
- aria-live="polite"
112
- aria-atomic={true}
113
- data-qa={createIdFromString(labelTextWhenNoError, "error message")}
114
- >
115
- {(field.hasErrors && field.dirty) || (field.hasErrors && showErrors)
116
- ? errorMessages[field.errors[0]]
117
- : ""}
118
- </Text>
113
+ id={createIdFromString(labelTextWhenNoError, "error message")}
114
+ aria-live="polite"
115
+ aria-atomic={true}
116
+ data-qa={createIdFromString(labelTextWhenNoError, "error message")}
117
+ >
118
+ {errorMessages[field.errors[0]]}
119
+ </Text>
120
+ ) : (
121
+ <Text extraStyles={`height: ${themeValues.lineHeight};`} />
122
+ )}
119
123
  </Stack>
120
124
  </SelectContainer>
121
125
  );
@@ -7,6 +7,8 @@ const AccountNumberImage = () => {
7
7
  width="371"
8
8
  height="164"
9
9
  viewBox="0 0 371 164"
10
+ role="img"
11
+ aria-label="A check with the account number highlighted in the bottom center"
10
12
  >
11
13
  <g fill="none" fillRule="evenodd" stroke="none" strokeWidth="1">
12
14
  <g transform="translate(-364 -546)">
@@ -8,6 +8,8 @@ export const BankIcon = () => {
8
8
  viewBox="0 0 28 18"
9
9
  fill="none"
10
10
  xmlns="http://www.w3.org/2000/svg"
11
+ role="img"
12
+ aria-label="Check Payment"
11
13
  >
12
14
  <path
13
15
  d="M0 2.25C0 1.00736 1.04467 0 2.33333 0H25.6667C26.9553 0 28 1.00736 28 2.25V15.75C28 16.9926 26.9553 18 25.6667 18H2.33333C1.04467 18 0 16.9926 0 15.75V2.25Z"
@@ -9,6 +9,8 @@ const CheckmarkIcon = () => (
9
9
  version="1.1"
10
10
  xmlns="http://www.w3.org/2000/svg"
11
11
  xmlnsXlink="http://www.w3.org/1999/xlink"
12
+ role="img"
13
+ aria-label="Successful payment, green checkmark"
12
14
  >
13
15
  <g
14
16
  id="Cityville-Checkout---Desktop---Logged-In"
@@ -7,6 +7,8 @@ const GenericCard = () => (
7
7
  viewBox="0 0 28 18"
8
8
  fill="none"
9
9
  xmlns="http://www.w3.org/2000/svg"
10
+ role="img"
11
+ aria-label="Card Payment"
10
12
  >
11
13
  <rect width="28" height="18" rx="2" fill="#15749D" />
12
14
  <path
@@ -8,6 +8,8 @@ const GenericCardLarge = () => {
8
8
  viewBox="0 0 36 24"
9
9
  fill="none"
10
10
  xmlns="http://www.w3.org/2000/svg"
11
+ role="img"
12
+ aria-label="Card Payment"
11
13
  >
12
14
  <rect width="36" height="24" rx="2" fill="#15749D" />
13
15
  <path
@@ -7,6 +7,8 @@ const RoutingNumberImage = () => {
7
7
  width="371"
8
8
  height="164"
9
9
  viewBox="0 0 371 164"
10
+ role="img"
11
+ aria-label="A check with the routing number highlighted in the lower left hand corner"
10
12
  >
11
13
  <g fill="none" fillRule="evenodd" stroke="none" strokeWidth="1">
12
14
  <g transform="translate(-365 -522)">
@@ -9,7 +9,8 @@ const FormStateDropdown = ({
9
9
  field,
10
10
  fieldActions,
11
11
  showErrors,
12
- countryCode
12
+ countryCode,
13
+ isRequired = false
13
14
  }) => {
14
15
  const placeholder =
15
16
  countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
@@ -23,6 +24,7 @@ const FormStateDropdown = ({
23
24
  errorMessages={errorMessages}
24
25
  showErrors={showErrors}
25
26
  autocompleteValue="address-level1"
27
+ isRequired={isRequired}
26
28
  />
27
29
  );
28
30
  };
@@ -71,6 +71,7 @@ const AddressForm = ({
71
71
  }}
72
72
  showErrors={showErrors}
73
73
  dataQa="Country"
74
+ isRequired={true}
74
75
  />
75
76
  <FormInput
76
77
  labelTextWhenNoError="Address"
@@ -81,6 +82,7 @@ const AddressForm = ({
81
82
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
82
83
  autocompleteValue="address-line1"
83
84
  dataQa="Address"
85
+ isRequired={true}
84
86
  />
85
87
  <FormInput
86
88
  labelTextWhenNoError="Apt, Suite, Unit, Floor, etc. (Optional)"
@@ -100,6 +102,7 @@ const AddressForm = ({
100
102
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
101
103
  autocompleteValue="address-level2"
102
104
  dataQa="City"
105
+ isRequired={true}
103
106
  />
104
107
  <StateProvinceDropdown
105
108
  labelTextWhenNoError={isUS ? "State" : "State or Province"}
@@ -110,6 +113,7 @@ const AddressForm = ({
110
113
  showErrors={showErrors}
111
114
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
112
115
  dataQa="State or Province"
116
+ isRequired={true}
113
117
  />
114
118
  <FormInput
115
119
  isNum={isUS}
@@ -122,6 +126,7 @@ const AddressForm = ({
122
126
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
123
127
  autocompleteValue="postal-code"
124
128
  dataQa="Zip code"
129
+ isRequired={true}
125
130
  />
126
131
  {showWalletCheckbox && (
127
132
  <Checkbox
@@ -19,7 +19,8 @@ const EmailForm = ({
19
19
  handleSubmit = noop,
20
20
  showWalletCheckbox,
21
21
  saveToWallet,
22
- walletCheckboxMarked
22
+ walletCheckboxMarked,
23
+ isRequired = false
23
24
  }) => {
24
25
  if (clearOnDismount) {
25
26
  useEffect(() => () => actions.form.clear(), []);
@@ -48,6 +49,7 @@ const EmailForm = ({
48
49
  isEmail
49
50
  autocompleteValue="email"
50
51
  dataQa="Email address"
52
+ isRequired={isRequired}
51
53
  />
52
54
  {showWalletCheckbox && (
53
55
  <Checkbox
@@ -4,3 +4,4 @@ export * from "./editable-table";
4
4
  export * from "./footer-with-subfooter";
5
5
  export * from "./popover";
6
6
  export * from "./radio-group";
7
+ export * from "./toast-notification";
@@ -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";
@@ -67,7 +67,8 @@ const Modal = ({
67
67
  alignItems: "center"
68
68
  }}
69
69
  dialogStyle={{
70
- width: customWidth || "615px"
70
+ width: customWidth || "615px",
71
+ overflow: "auto"
71
72
  }}
72
73
  underlayClickExits={underlayClickExits}
73
74
  >
@@ -76,6 +76,7 @@ const PaymentFormACH = ({
76
76
  showErrors={showErrors}
77
77
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
78
78
  autocompleteValue="name"
79
+ isRequired={true}
79
80
  />
80
81
  <FormInput
81
82
  labelTextWhenNoError="Routing number"
@@ -97,6 +98,7 @@ const PaymentFormACH = ({
97
98
  />
98
99
  )}
99
100
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
101
+ isRequired={true}
100
102
  />
101
103
  <FormInput
102
104
  labelTextWhenNoError="Confirm routing number"
@@ -107,6 +109,7 @@ const PaymentFormACH = ({
107
109
  showErrors={showErrors}
108
110
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
109
111
  isNum
112
+ isRequired={true}
110
113
  />
111
114
  <FormInput
112
115
  labelTextWhenNoError="Account number"
@@ -128,6 +131,7 @@ const PaymentFormACH = ({
128
131
  />
129
132
  )}
130
133
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
134
+ isRequired={true}
131
135
  />
132
136
  <FormInput
133
137
  labelTextWhenNoError="Confirm account number"
@@ -137,6 +141,7 @@ const PaymentFormACH = ({
137
141
  fieldActions={actions.fields.confirmAccountNumber}
138
142
  showErrors={showErrors}
139
143
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
144
+ isRequired={true}
140
145
  isNum
141
146
  />
142
147
  {allowBankAccountType && (
@@ -152,6 +157,7 @@ const PaymentFormACH = ({
152
157
  showErrors={showErrors}
153
158
  errorMessages={accountTypeErrors}
154
159
  field={fields.accountType}
160
+ isRequired={true}
155
161
  />
156
162
  )}
157
163
  {!hideDefaultPayment && (
@@ -121,6 +121,7 @@ const PaymentFormCard = ({
121
121
  showErrors={showErrors}
122
122
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
123
123
  autocompleteValue="cc-name"
124
+ isRequired={true}
124
125
  />
125
126
  <FormInput
126
127
  labelTextWhenNoError="Credit card number"
@@ -133,6 +134,7 @@ const PaymentFormCard = ({
133
134
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
134
135
  isNum
135
136
  autocompleteValue="cc-number"
137
+ isRequired={true}
136
138
  />
137
139
  <FormInputRow
138
140
  breakpoint={isMobile ? "1000rem" : "21rem"}
@@ -150,6 +152,7 @@ const PaymentFormCard = ({
150
152
  isNum
151
153
  removeFromValue={/\//} // removes "/" from browser autofill
152
154
  autocompleteValue="cc-exp"
155
+ isRequired={true}
153
156
  />
154
157
  <FormInput
155
158
  labelTextWhenNoError="CVV"
@@ -166,6 +169,7 @@ const PaymentFormCard = ({
166
169
  }
167
170
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
168
171
  autocompleteValue="cc-csc"
172
+ isRequired={true}
169
173
  />
170
174
  </FormInputRow>
171
175
  {!hideZipCode && (
@@ -184,6 +188,7 @@ const PaymentFormCard = ({
184
188
  showErrors={showErrors}
185
189
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
186
190
  autocompleteValue="billing postal-code"
191
+ isRequired={true}
187
192
  />
188
193
  </Box>
189
194
  )}
@@ -19,7 +19,8 @@ const PhoneForm = ({
19
19
  handleSubmit = noop,
20
20
  showWalletCheckbox,
21
21
  saveToWallet,
22
- walletCheckboxMarked
22
+ walletCheckboxMarked,
23
+ isRequired = false
23
24
  }) => {
24
25
  if (clearOnDismount) {
25
26
  useEffect(() => () => actions.form.clear(), []);
@@ -43,6 +44,7 @@ const PhoneForm = ({
43
44
  autocompleteValue="tel-national"
44
45
  dataQa="Phone number"
45
46
  isNum={true}
47
+ isRequired={isRequired}
46
48
  />
47
49
  {showWalletCheckbox && (
48
50
  <Checkbox
@@ -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 "../../../util";
7
+ import { useOutsideClick } from "../../../hooks";
8
8
  import { noop } from "../../../util/general";
9
9
  import { fallbackValues } from "./Popover.theme";
10
10