@thecb/components 2.2.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.
Files changed (308) hide show
  1. package/.eslintrc.json +29 -0
  2. package/.github/PULL_REQUEST_TEMPLATE.md +18 -0
  3. package/.github/stale.yml +17 -0
  4. package/.prettierignore +3 -0
  5. package/.tool-versions +1 -0
  6. package/README.md +149 -0
  7. package/dist/cb-components.cjs.js +77 -0
  8. package/package.json +96 -0
  9. package/rollup.config.js +35 -0
  10. package/src/components/atoms/alert/Alert.js +67 -0
  11. package/src/components/atoms/alert/Alert.theme.js +71 -0
  12. package/src/components/atoms/alert/index.js +3 -0
  13. package/src/components/atoms/amount-callout/AmountCallout.js +27 -0
  14. package/src/components/atoms/amount-callout/AmountCallout.theme.js +19 -0
  15. package/src/components/atoms/amount-callout/index.js +3 -0
  16. package/src/components/atoms/breadcrumb/Breadcrumb.js +50 -0
  17. package/src/components/atoms/breadcrumb/Breadcrumb.theme.js +25 -0
  18. package/src/components/atoms/breadcrumb/index.js +3 -0
  19. package/src/components/atoms/button-with-action/ButtonWithAction.js +128 -0
  20. package/src/components/atoms/button-with-action/ButtonWithAction.stories.js +125 -0
  21. package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +360 -0
  22. package/src/components/atoms/button-with-action/index.js +3 -0
  23. package/src/components/atoms/button-with-link/ButtonWithLink.js +40 -0
  24. package/src/components/atoms/button-with-link/index.js +3 -0
  25. package/src/components/atoms/checkbox/Checkbox.js +143 -0
  26. package/src/components/atoms/checkbox/Checkbox.theme.js +54 -0
  27. package/src/components/atoms/checkbox/index.js +3 -0
  28. package/src/components/atoms/checkbox-list/CheckboxList.js +129 -0
  29. package/src/components/atoms/checkbox-list/CheckboxList.theme.js +42 -0
  30. package/src/components/atoms/checkbox-list/index.js +3 -0
  31. package/src/components/atoms/country-dropdown/CountryDropdown.js +24 -0
  32. package/src/components/atoms/country-dropdown/index.js +1 -0
  33. package/src/components/atoms/country-dropdown/options.js +249 -0
  34. package/src/components/atoms/display-box/DisplayBox.js +22 -0
  35. package/src/components/atoms/display-box/DisplayBox.theme.js +9 -0
  36. package/src/components/atoms/display-box/index.js +3 -0
  37. package/src/components/atoms/display-card/DisplayCard.js +65 -0
  38. package/src/components/atoms/display-card/index.js +3 -0
  39. package/src/components/atoms/dropdown/Dropdown.js +299 -0
  40. package/src/components/atoms/dropdown/Dropdown.theme.js +9 -0
  41. package/src/components/atoms/dropdown/DropdownIcon.js +31 -0
  42. package/src/components/atoms/dropdown/index.js +3 -0
  43. package/src/components/atoms/form-layouts/FormContainer.js +28 -0
  44. package/src/components/atoms/form-layouts/FormInput.js +218 -0
  45. package/src/components/atoms/form-layouts/FormInputColumn.js +15 -0
  46. package/src/components/atoms/form-layouts/FormInputRow.js +26 -0
  47. package/src/components/atoms/form-layouts/FormLayouts.theme.js +52 -0
  48. package/src/components/atoms/form-layouts/index.js +6 -0
  49. package/src/components/atoms/form-select/FormSelect.js +62 -0
  50. package/src/components/atoms/form-select/FormSelect.styled.js +65 -0
  51. package/src/components/atoms/form-select/index.js +3 -0
  52. package/src/components/atoms/formatted-address/FormattedAddress.js +53 -0
  53. package/src/components/atoms/formatted-address/FormattedAddress.theme.js +11 -0
  54. package/src/components/atoms/formatted-address/index.js +3 -0
  55. package/src/components/atoms/hamburger-button/HamburgerButton.js +113 -0
  56. package/src/components/atoms/hamburger-button/index.js +3 -0
  57. package/src/components/atoms/heading/Heading.js +37 -0
  58. package/src/components/atoms/heading/Heading.styled.js +14 -0
  59. package/src/components/atoms/heading/Heading.theme.js +18 -0
  60. package/src/components/atoms/heading/index.js +3 -0
  61. package/src/components/atoms/icons/AccountsAddIcon.js +42 -0
  62. package/src/components/atoms/icons/AccountsIcon.js +37 -0
  63. package/src/components/atoms/icons/AccountsIconSmall.js +63 -0
  64. package/src/components/atoms/icons/ChevronIcon.js +51 -0
  65. package/src/components/atoms/icons/ForgotPasswordIcon.js +46 -0
  66. package/src/components/atoms/icons/GoToEmailIcon.js +31 -0
  67. package/src/components/atoms/icons/Icons.theme.js +38 -0
  68. package/src/components/atoms/icons/PaymentMethodIcon.js +42 -0
  69. package/src/components/atoms/icons/PaymentsIconSmall.js +63 -0
  70. package/src/components/atoms/icons/ProfileIconSmall.js +44 -0
  71. package/src/components/atoms/icons/PropertiesAddIcon.js +70 -0
  72. package/src/components/atoms/icons/PropertiesIconSmall.js +32 -0
  73. package/src/components/atoms/icons/SettingsIconSmall.js +63 -0
  74. package/src/components/atoms/icons/VerifiedEmailIcon.js +53 -0
  75. package/src/components/atoms/icons/index.js +28 -0
  76. package/src/components/atoms/index.js +33 -0
  77. package/src/components/atoms/labeled-amount/LabeledAmount.js +35 -0
  78. package/src/components/atoms/labeled-amount/LabeledAmount.theme.js +10 -0
  79. package/src/components/atoms/labeled-amount/index.js +3 -0
  80. package/src/components/atoms/layouts/Box.js +83 -0
  81. package/src/components/atoms/layouts/Box.styled.js +131 -0
  82. package/src/components/atoms/layouts/Center.js +28 -0
  83. package/src/components/atoms/layouts/Center.styled.js +18 -0
  84. package/src/components/atoms/layouts/Cluster.js +37 -0
  85. package/src/components/atoms/layouts/Cluster.styled.js +21 -0
  86. package/src/components/atoms/layouts/Cover.js +49 -0
  87. package/src/components/atoms/layouts/Cover.styled.js +29 -0
  88. package/src/components/atoms/layouts/Frame.js +28 -0
  89. package/src/components/atoms/layouts/Frame.styled.js +27 -0
  90. package/src/components/atoms/layouts/Grid.js +38 -0
  91. package/src/components/atoms/layouts/Grid.styled.js +22 -0
  92. package/src/components/atoms/layouts/Imposter.js +52 -0
  93. package/src/components/atoms/layouts/Imposter.styled.js +19 -0
  94. package/src/components/atoms/layouts/Motion.js +51 -0
  95. package/src/components/atoms/layouts/Motion.styled.js +41 -0
  96. package/src/components/atoms/layouts/Reel.js +28 -0
  97. package/src/components/atoms/layouts/Reel.styled.js +17 -0
  98. package/src/components/atoms/layouts/Sidebar.js +42 -0
  99. package/src/components/atoms/layouts/Sidebar.styled.js +38 -0
  100. package/src/components/atoms/layouts/Stack.js +36 -0
  101. package/src/components/atoms/layouts/Stack.styled.js +30 -0
  102. package/src/components/atoms/layouts/Switcher.js +64 -0
  103. package/src/components/atoms/layouts/Switcher.styled.js +44 -0
  104. package/src/components/atoms/layouts/examples/FixedSizeContainer.js +22 -0
  105. package/src/components/atoms/layouts/examples/FixedSizeContainer.styled.js +20 -0
  106. package/src/components/atoms/layouts/examples/LayoutContentBlock.js +27 -0
  107. package/src/components/atoms/layouts/examples/LayoutContentBlock.styled.js +15 -0
  108. package/src/components/atoms/layouts/examples/ResizingContainer.js +49 -0
  109. package/src/components/atoms/layouts/examples/ResizingContainer.styled.js +39 -0
  110. package/src/components/atoms/layouts/examples/cluster-example/ClusterExample.js +10 -0
  111. package/src/components/atoms/layouts/examples/cluster-example/ClusterExample.stories.js +97 -0
  112. package/src/components/atoms/layouts/examples/grid-example/GridExample.js +49 -0
  113. package/src/components/atoms/layouts/examples/grid-example/GridExample.stories.js +44 -0
  114. package/src/components/atoms/layouts/examples/sidebar-example/SidebarExample.js +11 -0
  115. package/src/components/atoms/layouts/examples/sidebar-example/SidebarExample.stories.js +87 -0
  116. package/src/components/atoms/layouts/examples/stack-example/StackExample.js +27 -0
  117. package/src/components/atoms/layouts/examples/stack-example/StackExample.stories.js +69 -0
  118. package/src/components/atoms/layouts/examples/switcher-example/SwitcherExample.js +38 -0
  119. package/src/components/atoms/layouts/examples/switcher-example/SwitcherExample.stories.js +65 -0
  120. package/src/components/atoms/layouts/index.js +27 -0
  121. package/src/components/atoms/line-item/LineItem.js +30 -0
  122. package/src/components/atoms/line-item/LineItem.theme.js +7 -0
  123. package/src/components/atoms/line-item/index.js +3 -0
  124. package/src/components/atoms/link/ExternalLink.js +50 -0
  125. package/src/components/atoms/link/ExternalLink.styled.js +26 -0
  126. package/src/components/atoms/link/InternalLink.js +51 -0
  127. package/src/components/atoms/link/InternalLink.styled.js +39 -0
  128. package/src/components/atoms/link/Link.theme.js +8 -0
  129. package/src/components/atoms/link/index.js +4 -0
  130. package/src/components/atoms/nav-footer/NavFooter.js +57 -0
  131. package/src/components/atoms/nav-footer/index.js +3 -0
  132. package/src/components/atoms/nav-header/NavHeader.js +36 -0
  133. package/src/components/atoms/nav-header/index.js +3 -0
  134. package/src/components/atoms/paragraph/Paragraph.js +31 -0
  135. package/src/components/atoms/paragraph/Paragraph.styled.js +13 -0
  136. package/src/components/atoms/paragraph/Paragraph.theme.js +18 -0
  137. package/src/components/atoms/paragraph/index.js +3 -0
  138. package/src/components/atoms/password-requirements/PasswordRequirements.js +116 -0
  139. package/src/components/atoms/password-requirements/index.js +3 -0
  140. package/src/components/atoms/placeholder/Placeholder.js +122 -0
  141. package/src/components/atoms/placeholder/Placeholder.theme.js +9 -0
  142. package/src/components/atoms/placeholder/index.js +3 -0
  143. package/src/components/atoms/processing-fee/ProcessingFee.js +43 -0
  144. package/src/components/atoms/processing-fee/ProcessingFee.theme.js +7 -0
  145. package/src/components/atoms/processing-fee/index.js +3 -0
  146. package/src/components/atoms/radio-button/RadioButton.js +101 -0
  147. package/src/components/atoms/radio-button/RadioButton.theme.js +9 -0
  148. package/src/components/atoms/radio-button/index.js +3 -0
  149. package/src/components/atoms/solid-divider/SolidDivider.js +22 -0
  150. package/src/components/atoms/solid-divider/SolidDivider.theme.js +8 -0
  151. package/src/components/atoms/solid-divider/index.js +3 -0
  152. package/src/components/atoms/spinner/Spinner.js +61 -0
  153. package/src/components/atoms/spinner/Spinner.theme.js +5 -0
  154. package/src/components/atoms/spinner/index.js +3 -0
  155. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +28 -0
  156. package/src/components/atoms/state-province-dropdown/index.js +3 -0
  157. package/src/components/atoms/state-province-dropdown/options.js +3837 -0
  158. package/src/components/atoms/text/Text.js +37 -0
  159. package/src/components/atoms/text/Text.styled.js +32 -0
  160. package/src/components/atoms/text/Text.theme.js +22 -0
  161. package/src/components/atoms/text/index.js +3 -0
  162. package/src/components/atoms/toggle-switch/ToggleSwitch.js +212 -0
  163. package/src/components/atoms/toggle-switch/ToggleSwitch.theme.js +36 -0
  164. package/src/components/atoms/toggle-switch/index.js +3 -0
  165. package/src/components/index.js +3 -0
  166. package/src/components/molecules/address-form/AddressForm.js +110 -0
  167. package/src/components/molecules/address-form/AddressForm.state.js +52 -0
  168. package/src/components/molecules/address-form/index.js +11 -0
  169. package/src/components/molecules/change-password-form/ChangePasswordForm.js +92 -0
  170. package/src/components/molecules/change-password-form/ChangePasswordForm.state.js +33 -0
  171. package/src/components/molecules/change-password-form/index.js +11 -0
  172. package/src/components/molecules/collapsible-section/CollapsibleSection.js +126 -0
  173. package/src/components/molecules/collapsible-section/CollapsibleSection.theme.js +11 -0
  174. package/src/components/molecules/collapsible-section/index.js +3 -0
  175. package/src/components/molecules/edit-name-form/EditNameForm.js +51 -0
  176. package/src/components/molecules/edit-name-form/EditNameForm.state.js +14 -0
  177. package/src/components/molecules/edit-name-form/index.js +11 -0
  178. package/src/components/molecules/email-form/EmailForm.js +55 -0
  179. package/src/components/molecules/email-form/EmailForm.state.js +19 -0
  180. package/src/components/molecules/email-form/index.js +11 -0
  181. package/src/components/molecules/forgot-password-form/ForgotPasswordForm.js +32 -0
  182. package/src/components/molecules/forgot-password-form/ForgotPasswordForm.state.js +11 -0
  183. package/src/components/molecules/forgot-password-form/index.js +11 -0
  184. package/src/components/molecules/highlight-tab-row/HighlightTabRow.js +62 -0
  185. package/src/components/molecules/highlight-tab-row/HighlightTabRow.theme.js +7 -0
  186. package/src/components/molecules/highlight-tab-row/index.js +8 -0
  187. package/src/components/molecules/index.js +24 -0
  188. package/src/components/molecules/login-form/LoginForm.js +46 -0
  189. package/src/components/molecules/login-form/LoginForm.state.js +14 -0
  190. package/src/components/molecules/login-form/index.js +11 -0
  191. package/src/components/molecules/modal/Modal.js +138 -0
  192. package/src/components/molecules/modal/index.js +3 -0
  193. package/src/components/molecules/module/Module.js +42 -0
  194. package/src/components/molecules/module/Module.theme.js +30 -0
  195. package/src/components/molecules/module/index.js +8 -0
  196. package/src/components/molecules/nav-menu/NavMenu.theme.js +5 -0
  197. package/src/components/molecules/nav-menu/NavMenuDesktop.js +39 -0
  198. package/src/components/molecules/nav-menu/NavMenuMobile.js +63 -0
  199. package/src/components/molecules/nav-menu/index.js +4 -0
  200. package/src/components/molecules/obligation/Obligation.js +69 -0
  201. package/src/components/molecules/obligation/icons/AccountBillIcon.js +89 -0
  202. package/src/components/molecules/obligation/icons/AccountConstructionIcon.js +99 -0
  203. package/src/components/molecules/obligation/icons/AccountDentalIcon.js +94 -0
  204. package/src/components/molecules/obligation/icons/AccountElectricIcon.js +99 -0
  205. package/src/components/molecules/obligation/icons/AccountGarbageIcon.js +94 -0
  206. package/src/components/molecules/obligation/icons/AccountGasIcon.js +94 -0
  207. package/src/components/molecules/obligation/icons/AccountGenericIcon.js +89 -0
  208. package/src/components/molecules/obligation/icons/AccountMedicalIcon.js +94 -0
  209. package/src/components/molecules/obligation/icons/AccountWaterIcon.js +94 -0
  210. package/src/components/molecules/obligation/icons/PropertyApartmentIcon.js +99 -0
  211. package/src/components/molecules/obligation/icons/PropertyBusinessIcon.js +94 -0
  212. package/src/components/molecules/obligation/icons/PropertyCarIcon.js +99 -0
  213. package/src/components/molecules/obligation/icons/PropertyCommercialVehicleIcon.js +100 -0
  214. package/src/components/molecules/obligation/icons/PropertyGarageIcon.js +96 -0
  215. package/src/components/molecules/obligation/icons/PropertyLandIcon.js +99 -0
  216. package/src/components/molecules/obligation/icons/PropertyMotorcycleIcon.js +99 -0
  217. package/src/components/molecules/obligation/icons/PropertyPersonalIcon.js +94 -0
  218. package/src/components/molecules/obligation/icons/PropertyStorefrontIcon.js +100 -0
  219. package/src/components/molecules/obligation/icons/index.js +60 -0
  220. package/src/components/molecules/obligation/index.js +3 -0
  221. package/src/components/molecules/obligation/modules/AmountModule.js +36 -0
  222. package/src/components/molecules/obligation/modules/IconModule.js +29 -0
  223. package/src/components/molecules/obligation/modules/PaymentDetailsActions.js +67 -0
  224. package/src/components/molecules/obligation/modules/TitleModule.js +25 -0
  225. package/src/components/molecules/obligation/modules/index.js +6 -0
  226. package/src/components/molecules/payment-button-bar/PaymentButtonBar.js +80 -0
  227. package/src/components/molecules/payment-button-bar/index.js +3 -0
  228. package/src/components/molecules/payment-details/PaymentDetails.js +158 -0
  229. package/src/components/molecules/payment-details/PaymentDetails.theme.js +11 -0
  230. package/src/components/molecules/payment-details/index.js +1 -0
  231. package/src/components/molecules/phone-form/PhoneForm.js +44 -0
  232. package/src/components/molecules/phone-form/PhoneForm.state.js +17 -0
  233. package/src/components/molecules/phone-form/index.js +11 -0
  234. package/src/components/molecules/radio-section/RadioSection.js +205 -0
  235. package/src/components/molecules/radio-section/RadioSection.theme.js +15 -0
  236. package/src/components/molecules/radio-section/index.js +3 -0
  237. package/src/components/molecules/registration-form/RegistrationForm.js +104 -0
  238. package/src/components/molecules/registration-form/RegistrationForm.state.js +40 -0
  239. package/src/components/molecules/registration-form/index.js +11 -0
  240. package/src/components/molecules/reset-confirmation-form/ResetConfirmationForm.js +56 -0
  241. package/src/components/molecules/reset-confirmation-form/index.js +3 -0
  242. package/src/components/molecules/reset-password-form/ResetPasswordForm.js +67 -0
  243. package/src/components/molecules/reset-password-form/ResetPasswordForm.state.js +30 -0
  244. package/src/components/molecules/reset-password-form/index.js +11 -0
  245. package/src/components/molecules/reset-password-success/ResetPasswordSuccess.js +55 -0
  246. package/src/components/molecules/reset-password-success/index.js +3 -0
  247. package/src/components/molecules/tab-sidebar/TabSidebar.js +92 -0
  248. package/src/components/molecules/tab-sidebar/TabSidebar.theme.js +9 -0
  249. package/src/components/molecules/tab-sidebar/index.js +3 -0
  250. package/src/components/molecules/terms-and-conditions/TermsAndConditions.js +73 -0
  251. package/src/components/molecules/terms-and-conditions/index.js +3 -0
  252. package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.js +64 -0
  253. package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.theme.js +28 -0
  254. package/src/components/molecules/terms-and-conditions-modal/index.js +3 -0
  255. package/src/components/molecules/workflow-tile/WorkflowTile.js +58 -0
  256. package/src/components/molecules/workflow-tile/index.js +3 -0
  257. package/src/components/templates/center-single/CenterSingle.js +61 -0
  258. package/src/components/templates/center-single/index.js +3 -0
  259. package/src/components/templates/center-stack/CenterStack.js +49 -0
  260. package/src/components/templates/center-stack/index.js +3 -0
  261. package/src/components/templates/default-page-template/DefaultPageTemplate.js +49 -0
  262. package/src/components/templates/default-page-template/index.js +3 -0
  263. package/src/components/templates/index.js +5 -0
  264. package/src/components/templates/sidebar-single-content/SidebarSingleContent.js +60 -0
  265. package/src/components/templates/sidebar-single-content/index.js +3 -0
  266. package/src/components/templates/sidebar-stack-content/SidebarStackContent.js +81 -0
  267. package/src/components/templates/sidebar-stack-content/index.js +3 -0
  268. package/src/components/templates/templates.theme.js +5 -0
  269. package/src/components/withWindowSize.js +50 -0
  270. package/src/constants/colors.js +178 -0
  271. package/src/constants/regex_constants.js +1 -0
  272. package/src/constants/style_constants.js +21 -0
  273. package/src/deprecated/colors.js +154 -0
  274. package/src/deprecated/components/radio-button/index.js +3 -0
  275. package/src/deprecated/components/radio-button/radio-button.js +44 -0
  276. package/src/deprecated/icons/AlertErrorIcon.js +42 -0
  277. package/src/deprecated/icons/AlertInfoIcon.js +42 -0
  278. package/src/deprecated/icons/AlertSuccessIcon.js +42 -0
  279. package/src/deprecated/icons/AlertWarningIcon.js +36 -0
  280. package/src/deprecated/icons/BankIcon.js +82 -0
  281. package/src/deprecated/icons/GenericCard.js +39 -0
  282. package/src/deprecated/icons/IconAdd.js +44 -0
  283. package/src/deprecated/icons/IconCheck.js +23 -0
  284. package/src/deprecated/icons/IconCheckEmail.js +46 -0
  285. package/src/deprecated/icons/IconChevron.js +35 -0
  286. package/src/deprecated/icons/IconEmailVerified.js +62 -0
  287. package/src/deprecated/icons/IconEye.js +32 -0
  288. package/src/deprecated/icons/IconEyeSlash.js +48 -0
  289. package/src/deprecated/icons/IconInvalid.js +69 -0
  290. package/src/deprecated/icons/IconNeutral.js +27 -0
  291. package/src/deprecated/icons/IconQuit.js +32 -0
  292. package/src/deprecated/icons/IconValid.js +72 -0
  293. package/src/deprecated/icons/IconWarn.js +28 -0
  294. package/src/deprecated/icons/index.js +40 -0
  295. package/src/deprecated/index.js +1 -0
  296. package/src/deprecated/spinner/Spinner.js +68 -0
  297. package/src/deprecated/spinner/index.js +1 -0
  298. package/src/deprecated/utility/__tests__/safeConcat.spec.js +59 -0
  299. package/src/deprecated/utility/__tests__/validateKeyType.spec.js +116 -0
  300. package/src/deprecated/utility/index.js +2 -0
  301. package/src/deprecated/utility/safeConcat.js +10 -0
  302. package/src/deprecated/utility/validateKeyType.js +19 -0
  303. package/src/index.js +2 -0
  304. package/src/util/formats.js +30 -0
  305. package/src/util/general.js +15 -0
  306. package/src/util/inputValidationUtils.js +257 -0
  307. package/src/util/router-utils.js +23 -0
  308. package/src/util/themeUtils.js +144 -0
@@ -0,0 +1,40 @@
1
+ import {
2
+ createFormState,
3
+ required,
4
+ matchesField,
5
+ hasLength,
6
+ hasNumber,
7
+ hasLowercaseLetter,
8
+ hasUppercaseLetter,
9
+ hasSpecialCharacter,
10
+ isProbablyEmail
11
+ } from "redux-freeform";
12
+
13
+ const formConfig = {
14
+ firstName: {
15
+ validators: [required()]
16
+ },
17
+ lastName: {
18
+ validators: [required()]
19
+ },
20
+ email: {
21
+ validators: [required(), isProbablyEmail()]
22
+ },
23
+ password: {
24
+ validators: [
25
+ required(),
26
+ hasLength(8, 100),
27
+ hasNumber(),
28
+ hasLowercaseLetter(),
29
+ hasUppercaseLetter(),
30
+ hasSpecialCharacter()
31
+ ]
32
+ },
33
+ confirmPassword: {
34
+ validators: [required(), matchesField("password")]
35
+ }
36
+ };
37
+
38
+ export const { reducer, mapStateToProps, mapDispatchToProps } = createFormState(
39
+ formConfig
40
+ );
@@ -0,0 +1,11 @@
1
+ import RegistrationForm from "./RegistrationForm";
2
+ import {
3
+ reducer,
4
+ mapStateToProps,
5
+ mapDispatchToProps,
6
+ } from "./RegistrationForm.state";
7
+
8
+ RegistrationForm.reducer = reducer;
9
+ RegistrationForm.mapStateToProps = mapStateToProps;
10
+ RegistrationForm.mapDispatchToProps = mapDispatchToProps;
11
+ export default RegistrationForm;
@@ -0,0 +1,56 @@
1
+ import React, { useContext } from "react";
2
+ import { ThemeContext } from "styled-components";
3
+ import Heading from "../../atoms/heading";
4
+ import Paragraph from "../../atoms/paragraph";
5
+ import { Box, Cluster } from "../../atoms/layouts";
6
+ import { GRECIAN_GREY, CHARADE_GREY, WHITE } from "../../../constants/colors";
7
+ import ButtonWithLink from "../../atoms/button-with-link";
8
+ import { ForgotPasswordIcon } from "../../atoms/icons";
9
+ import withWindowSize from "../../withWindowSize";
10
+ import { FormContainer, FormInputColumn } from "../../atoms/form-layouts";
11
+
12
+ const ResetConfirmationForm = () => {
13
+ const { isMobile } = useContext(ThemeContext);
14
+
15
+ return (
16
+ <Box
17
+ padding="0"
18
+ width={isMobile ? `auto` : `576px`}
19
+ borderRadius="4px"
20
+ background={WHITE}
21
+ boxShadow="0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)"
22
+ >
23
+ <Box background={GRECIAN_GREY} minWidth="100%" padding="0.5rem">
24
+ <Cluster justify="center" align="center">
25
+ <ForgotPasswordIcon />
26
+ </Cluster>
27
+ </Box>
28
+ <FormContainer role="form" aria-label="Reset password confirmation">
29
+ <FormInputColumn childGap="0.5rem">
30
+ <Box padding="0">
31
+ <Heading color={CHARADE_GREY} variant="h5" weight="600">
32
+ Password reset link sent
33
+ </Heading>
34
+ </Box>
35
+ <Box padding="0">
36
+ <Paragraph variant="p" color={CHARADE_GREY}>
37
+ Your password link was sent successfully. Check your email for a
38
+ reset password link.
39
+ </Paragraph>
40
+ </Box>
41
+ </FormInputColumn>
42
+ <Box padding={isMobile ? "1rem 0 0" : "1.5rem 0 0"}>
43
+ <Cluster justify="center" align="center">
44
+ <ButtonWithLink
45
+ url="/login"
46
+ text="Back to Login"
47
+ variant="primary"
48
+ extraStyles={`width: 100%;`}
49
+ />
50
+ </Cluster>
51
+ </Box>
52
+ </FormContainer>
53
+ </Box>
54
+ );
55
+ };
56
+ export default withWindowSize(ResetConfirmationForm);
@@ -0,0 +1,3 @@
1
+ import ResetConfirmationForm from "./ResetConfirmationForm";
2
+
3
+ export default ResetConfirmationForm;
@@ -0,0 +1,67 @@
1
+ import React, { useEffect } from "react";
2
+ import {
3
+ required,
4
+ hasLength,
5
+ matchesField,
6
+ hasNumber,
7
+ hasLowercaseLetter,
8
+ hasUppercaseLetter,
9
+ hasSpecialCharacter
10
+ } from "redux-freeform";
11
+ import PasswordRequirements from "../../atoms/password-requirements";
12
+ import { Box } from "../../atoms/layouts";
13
+ import { FormInput, FormInputColumn } from "../../atoms/form-layouts";
14
+ const ResetPasswordForm = ({
15
+ handleSubmit,
16
+ clearOnDismount,
17
+ fields,
18
+ actions,
19
+ showErrors,
20
+ isMobile
21
+ }) => {
22
+ if (clearOnDismount) {
23
+ useEffect(() => () => actions.form.clear(), []);
24
+ }
25
+ const passwordErrorMessages = {
26
+ [required.error]: "Password is required",
27
+ [hasLength.error]: "Password must have at least 8 characters",
28
+ [hasNumber.error]: "Password must contain at least one number",
29
+ [hasLowercaseLetter.error]:
30
+ "Password must contain at least one lowercase letter",
31
+ [hasUppercaseLetter.error]:
32
+ "Password must contain at least one uppercase letter",
33
+ [hasSpecialCharacter.error]:
34
+ "Password must contain at least one special character (!@#$%^&*.?)"
35
+ };
36
+ const confirmPasswordErrorMessages = {
37
+ [matchesField.error]: "Confirm password must match password"
38
+ };
39
+
40
+ return (
41
+ <FormInputColumn role="form" aria-label="Reset password">
42
+ <FormInput
43
+ labelTextWhenNoError="Password"
44
+ errorMessages={passwordErrorMessages}
45
+ field={fields.password}
46
+ fieldActions={actions.fields.password}
47
+ showErrors={showErrors}
48
+ onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
49
+ type="password"
50
+ />
51
+ <FormInput
52
+ labelTextWhenNoError="Confirm password"
53
+ errorMessages={confirmPasswordErrorMessages}
54
+ field={fields.confirmPassword}
55
+ fieldActions={actions.fields.confirmPassword}
56
+ showErrors={showErrors}
57
+ onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
58
+ type="password"
59
+ />
60
+ <Box padding={isMobile ? "0" : "0.5rem 0 0"}>
61
+ <PasswordRequirements password={fields.password} isMobile={isMobile} />
62
+ </Box>
63
+ </FormInputColumn>
64
+ );
65
+ };
66
+
67
+ export default ResetPasswordForm;
@@ -0,0 +1,30 @@
1
+ import {
2
+ createFormState,
3
+ required,
4
+ matchesField,
5
+ hasLength,
6
+ hasNumber,
7
+ hasLowercaseLetter,
8
+ hasUppercaseLetter,
9
+ hasSpecialCharacter
10
+ } from "redux-freeform";
11
+
12
+ const formConfig = {
13
+ password: {
14
+ validators: [
15
+ required(),
16
+ hasLength(8, 100),
17
+ hasNumber(),
18
+ hasLowercaseLetter(),
19
+ hasUppercaseLetter(),
20
+ hasSpecialCharacter()
21
+ ]
22
+ },
23
+ confirmPassword: {
24
+ validators: [required(), matchesField("password")]
25
+ }
26
+ };
27
+
28
+ export const { reducer, mapStateToProps, mapDispatchToProps } = createFormState(
29
+ formConfig
30
+ );
@@ -0,0 +1,11 @@
1
+ import ResetPasswordForm from "./ResetPasswordForm";
2
+ import {
3
+ reducer,
4
+ mapStateToProps,
5
+ mapDispatchToProps,
6
+ } from "./ResetPasswordForm.state";
7
+
8
+ ResetPasswordForm.reducer = reducer;
9
+ ResetPasswordForm.mapStateToProps = mapStateToProps;
10
+ ResetPasswordForm.mapDispatchToProps = mapDispatchToProps;
11
+ export default ResetPasswordForm;
@@ -0,0 +1,55 @@
1
+ import React, { useContext } from "react";
2
+ import { ThemeContext } from "styled-components";
3
+ import Heading from "../../atoms/heading";
4
+ import Paragraph from "../../atoms/paragraph";
5
+ import { Box, Cluster } from "../../atoms/layouts";
6
+ import { GRECIAN_GREY, CHARADE_GREY, WHITE } from "../../../constants/colors";
7
+ import ButtonWithLink from "../../atoms/button-with-link";
8
+ import { ForgotPasswordIcon } from "../../atoms/icons";
9
+ import withWindowSize from "../../withWindowSize";
10
+ import { FormContainer, FormInputColumn } from "../../atoms/form-layouts";
11
+
12
+ const ResetConfirmationForm = () => {
13
+ const { isMobile } = useContext(ThemeContext);
14
+
15
+ return (
16
+ <Box
17
+ padding="0"
18
+ width={isMobile ? `auto` : `576px`}
19
+ borderRadius="4px"
20
+ background={WHITE}
21
+ boxShadow="0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)"
22
+ >
23
+ <Box background={GRECIAN_GREY} minWidth="100%" padding="0.5rem">
24
+ <Cluster justify="center" align="center">
25
+ <ForgotPasswordIcon />
26
+ </Cluster>
27
+ </Box>
28
+ <FormContainer role="form" aria-label="Reset password success">
29
+ <FormInputColumn childGap="0.5rem">
30
+ <Box padding="0">
31
+ <Heading color={CHARADE_GREY} variant="h5" weight="600">
32
+ Password reset successful
33
+ </Heading>
34
+ </Box>
35
+ <Box padding="0">
36
+ <Paragraph variant="p" color={CHARADE_GREY}>
37
+ You can now log in using your new password
38
+ </Paragraph>
39
+ </Box>
40
+ <Box padding={isMobile ? "0.5rem 0 0" : "1rem 0 0"}>
41
+ <Cluster justify="center" align="center">
42
+ <ButtonWithLink
43
+ url="/login"
44
+ text="Log in"
45
+ variant="primary"
46
+ extraStyles={`width: 100%;`}
47
+ />
48
+ </Cluster>
49
+ </Box>
50
+ </FormInputColumn>
51
+ </FormContainer>
52
+ </Box>
53
+ );
54
+ };
55
+ export default withWindowSize(ResetConfirmationForm);
@@ -0,0 +1,3 @@
1
+ import ResetPasswordSuccess from "./ResetPasswordSuccess";
2
+
3
+ export default ResetPasswordSuccess;
@@ -0,0 +1,92 @@
1
+ import React from "react";
2
+ import { Box, Switcher, Cluster } from "../../atoms/layouts";
3
+ import {
4
+ BRIGHT_GREY,
5
+ GHOST_GREY,
6
+ ATHENS_GREY,
7
+ TRANSPARENT
8
+ } from "../../../constants/colors";
9
+ import Text from "../../atoms/text";
10
+ import { InternalLink } from "../../atoms/link";
11
+ import {
12
+ FONT_WEIGHT_BOLD,
13
+ FONT_WEIGHT_REGULAR
14
+ } from "../../../constants/style_constants";
15
+ import { themeComponent } from "../../../util/themeUtils";
16
+ import { fallbackValues } from "./TabSidebar.theme";
17
+
18
+ const TabSidebar = ({ links, isMobile, themeValues }) => (
19
+ <Box
20
+ padding="0"
21
+ background={ATHENS_GREY}
22
+ minHeight="100%"
23
+ role="region"
24
+ aria-label="Profile tabs"
25
+ boxShadow={isMobile && `inset 0px -1px 0px 0px rgb(202, 206, 216)`}
26
+ >
27
+ <Switcher
28
+ breakpoint="20rem"
29
+ childGap="0.1px"
30
+ padding="0"
31
+ extraStyles={!isMobile && `overflow: visible;`}
32
+ >
33
+ {links.map(({ route, text, active, icon }, index) => (
34
+ <InternalLink
35
+ to={route}
36
+ key={`${route}-${index}`}
37
+ hoverStyles={
38
+ active
39
+ ? `> * {background-color: ${themeValues.activeTabHover};}`
40
+ : `> * {background-color: rgba(8, 27, 43, 0.05);}`
41
+ }
42
+ >
43
+ <Box
44
+ padding={isMobile ? "6px 4px" : "18px 16px"}
45
+ background={
46
+ active ? themeValues.activeTabBackground : "transparent"
47
+ }
48
+ borderSize={active ? "3px" : "1px"}
49
+ borderColor={active ? themeValues.activeTabAccent : TRANSPARENT}
50
+ borderWidthOverride="0 0 3px 0"
51
+ boxShadow={
52
+ active
53
+ ? `0px 2px 4px 0px ${GHOST_GREY}, 0px 2px 9px 1px ${GHOST_GREY}`
54
+ : `0px 2px 4px 0px ${TRANSPARENT}, 0px 2px 9px 1px ${TRANSPARENT}`
55
+ }
56
+ minWidth="100%"
57
+ borderRadius="4px 4px 0 0"
58
+ >
59
+ <Box
60
+ padding="0"
61
+ minWidth="100%"
62
+ extraStyles={
63
+ isMobile ? `text-align: center;` : `text-align: left;`
64
+ }
65
+ >
66
+ <Cluster
67
+ justify={isMobile ? "center" : "flex-start"}
68
+ align="center"
69
+ >
70
+ {icon}
71
+ <Text
72
+ variant={isMobile ? "pXXS" : "pS"}
73
+ weight={active ? FONT_WEIGHT_BOLD : FONT_WEIGHT_REGULAR}
74
+ color={active ? themeValues.activeTabAccent : BRIGHT_GREY}
75
+ extraStyles={`text-transform: uppercase; ${
76
+ isMobile
77
+ ? `width: 100%; padding-top: 4px;`
78
+ : `padding-left: 8px;`
79
+ }`}
80
+ >
81
+ {text}
82
+ </Text>
83
+ </Cluster>
84
+ </Box>
85
+ </Box>
86
+ </InternalLink>
87
+ ))}
88
+ </Switcher>
89
+ </Box>
90
+ );
91
+
92
+ export default themeComponent(TabSidebar, "ProfileTab", fallbackValues);
@@ -0,0 +1,9 @@
1
+ const activeTabBackground = "#FFFFFF";
2
+ const activeTabAccent = "#15749D";
3
+ const activeTabHover = "#B8D5E1";
4
+
5
+ export const fallbackValues = {
6
+ activeTabBackground,
7
+ activeTabAccent,
8
+ activeTabHover
9
+ };
@@ -0,0 +1,3 @@
1
+ import TabSidebar from "./TabSidebar";
2
+
3
+ export default TabSidebar;
@@ -0,0 +1,73 @@
1
+ import React, { useState } from "react";
2
+ import styled from "styled-components";
3
+ import Checkbox from "../../atoms/checkbox";
4
+ import Text from "../../atoms/text";
5
+ import { Box, Stack } from "../../atoms/layouts";
6
+ import DisplayBox from "../../atoms/display-box";
7
+ import { FONT_WEIGHT_BOLD } from "../../../constants/style_constants";
8
+ import TermsAndConditionsModal from "../../molecules/terms-and-conditions-modal";
9
+
10
+ const CheckboxWrapper = styled.div`
11
+ outline: none;
12
+ `;
13
+
14
+ const ModalWrapper = styled.div``;
15
+
16
+ const TermsAndConditions = ({
17
+ onCheck,
18
+ isChecked,
19
+ html,
20
+ terms,
21
+ error = false
22
+ }) => {
23
+ const [showTerms, toggleShowTerms] = useState(false);
24
+ const [checkboxFocused, focusCheckbox] = useState(false);
25
+
26
+ const handleClick = (e, func) => {
27
+ if (e?.keyCode === 13) {
28
+ func();
29
+ }
30
+ };
31
+
32
+ return (
33
+ <DisplayBox>
34
+ <Stack direction="row">
35
+ <CheckboxWrapper
36
+ tabIndex="0"
37
+ onFocus={() => focusCheckbox(true)}
38
+ onBlur={() => focusCheckbox(false)}
39
+ onKeyDown={e => handleClick(e, onCheck)}
40
+ >
41
+ <Checkbox
42
+ name="terms"
43
+ error={error}
44
+ checked={isChecked}
45
+ onChange={onCheck}
46
+ focused={checkboxFocused}
47
+ />
48
+ </CheckboxWrapper>
49
+ <Stack>
50
+ <Text variant="p" fontWeight={FONT_WEIGHT_BOLD}>
51
+ Terms and Conditions
52
+ </Text>
53
+ <Box padding="0">{html}</Box>
54
+ {terms && (
55
+ <ModalWrapper
56
+ tabIndex="0"
57
+ onKeyDown={e => handleClick(e, () => toggleShowTerms(!showTerms))}
58
+ >
59
+ <TermsAndConditionsModal
60
+ link="Learn More"
61
+ terms={terms}
62
+ isOpen={showTerms}
63
+ toggleOpen={toggleShowTerms}
64
+ />
65
+ </ModalWrapper>
66
+ )}
67
+ </Stack>
68
+ </Stack>
69
+ </DisplayBox>
70
+ );
71
+ };
72
+
73
+ export default TermsAndConditions;
@@ -0,0 +1,3 @@
1
+ import TermsAndConditions from "./TermsAndConditions";
2
+
3
+ export default TermsAndConditions;
@@ -0,0 +1,64 @@
1
+ import React from "react";
2
+ import Modal from "../modal";
3
+ import Text from "../../atoms/text";
4
+ import { Box } from "../../atoms/layouts";
5
+ import { fallbackValues } from "./TermsAndConditionsModal.theme";
6
+ import { themeComponent } from "../../../util/themeUtils";
7
+
8
+ const TermsAndConditionsModal = ({
9
+ link,
10
+ title = "Terms & Conditions",
11
+ isOpen,
12
+ toggleOpen,
13
+ toggleAccepted,
14
+ acceptText,
15
+ terms,
16
+ variant,
17
+ themeValues
18
+ }) => (
19
+ <Modal
20
+ ModalLink={() => (
21
+ <Text
22
+ variant={variant === "default" ? "pS" : "pXS"}
23
+ onClick={() => toggleOpen(true)}
24
+ color={themeValues.linkColor}
25
+ weight={themeValues.fontWeight}
26
+ hoverStyles={themeValues.modalLinkHoverFocus}
27
+ focusStyles={themeValues.modalLinkHoverFocus}
28
+ extraStyles={`cursor: pointer;`}
29
+ tabIndex="0"
30
+ onKeyPress={e => e.key === "Enter" && toggleOpen(true)}
31
+ >
32
+ {link}
33
+ </Text>
34
+ )}
35
+ modalOpen={isOpen}
36
+ hideModal={() => toggleOpen(false)}
37
+ showModal={() => toggleOpen(true)}
38
+ modalHeaderText={title}
39
+ modalBodyText={
40
+ <Box
41
+ background={themeValues.backgroundColor}
42
+ border={`1px solid ${themeValues.border}`}
43
+ borderRadius="3px"
44
+ extraStyles="overflow: scroll; max-height: 20rem;"
45
+ >
46
+ <Text variant="p">{terms}</Text>
47
+ </Box>
48
+ }
49
+ defaultWrapper={false}
50
+ onlyCloseButton={!acceptText}
51
+ continueButtonText={acceptText}
52
+ continueAction={() => {
53
+ toggleAccepted(true);
54
+ toggleOpen(false);
55
+ }}
56
+ />
57
+ );
58
+
59
+ export default themeComponent(
60
+ TermsAndConditionsModal,
61
+ "TermsAndConditionsModal",
62
+ fallbackValues,
63
+ "default"
64
+ );
@@ -0,0 +1,28 @@
1
+ import {
2
+ FONT_WEIGHT_REGULAR,
3
+ FONT_WEIGHT_SEMIBOLD
4
+ } from "../../../constants/style_constants";
5
+
6
+ const backgroundColor = { default: "#ffffff", footer: "#ffffff" };
7
+ const linkColor = { default: "#357fb8", footer: "#ffffff" };
8
+ const border = { default: "#cdcdcd", footer: "#cdcdcd" };
9
+ const fontSize = { default: "1rem", footer: "0.875rem" };
10
+ const lineHeight = { default: "1.5rem", footer: "1.25rem" };
11
+ const fontWeight = {
12
+ default: FONT_WEIGHT_REGULAR,
13
+ footer: FONT_WEIGHT_SEMIBOLD
14
+ };
15
+ const modalLinkHoverFocus = {
16
+ default: ``,
17
+ footer: `outline: none; text-decoration: underline;`
18
+ };
19
+
20
+ export const fallbackValues = {
21
+ backgroundColor,
22
+ linkColor,
23
+ border,
24
+ fontSize,
25
+ lineHeight,
26
+ fontWeight,
27
+ modalLinkHoverFocus
28
+ };
@@ -0,0 +1,3 @@
1
+ import TermsAndConditionsModal from "./TermsAndConditionsModal";
2
+
3
+ export default TermsAndConditionsModal;
@@ -0,0 +1,58 @@
1
+ import React from "react";
2
+ import Heading from "../../atoms/heading";
3
+ import Paragraph from "../../atoms/paragraph";
4
+ import {
5
+ MATISSE_BLUE,
6
+ CHARADE_GREY,
7
+ STORM_GREY,
8
+ WHITE,
9
+ GHOST_GREY,
10
+ GRECIAN_GREY
11
+ } from "../../../constants/colors";
12
+ import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
13
+ import ButtonWithLink from "../../atoms/button-with-link";
14
+ import { Box, Stack } from "../../atoms/layouts";
15
+ const WorkflowTile = ({
16
+ workflowName = "Test Workflow",
17
+ workflowDescription,
18
+ slug
19
+ }) => (
20
+ <Box
21
+ background={WHITE}
22
+ boxShadow={`0px 0px 5px 0px ${GHOST_GREY}`}
23
+ padding={0}
24
+ >
25
+ <Stack childGap={0} bottomItem={3} fullHeight>
26
+ <Box padding={"1rem 1rem 0 1rem"}>
27
+ <Heading
28
+ variant="h6"
29
+ weight={FONT_WEIGHT_SEMIBOLD}
30
+ color={CHARADE_GREY}
31
+ margin={"0 0 0.5rem 0"}
32
+ >
33
+ {workflowName}
34
+ </Heading>
35
+ </Box>
36
+ <Box padding={"0 1rem 1rem 1rem"} minHeight={"4.25rem"}>
37
+ <Paragraph variant="pS" color={STORM_GREY}>
38
+ {workflowDescription || `Link your benefit plan`}
39
+ </Paragraph>
40
+ </Box>
41
+ <Box padding={"1.5rem 1rem"} background={GRECIAN_GREY}>
42
+ <ButtonWithLink
43
+ primary
44
+ primaryBG={MATISSE_BLUE}
45
+ fontWeight={FONT_WEIGHT_SEMIBOLD}
46
+ fontSize={"1.125rem"}
47
+ borderRadius={"0px"}
48
+ text={"Link Benefits"}
49
+ minWidth={"100%"}
50
+ url={`/service/${slug}`}
51
+ extraStyles={`width: 100%;`}
52
+ />
53
+ </Box>
54
+ </Stack>
55
+ </Box>
56
+ );
57
+
58
+ export default WorkflowTile;
@@ -0,0 +1,3 @@
1
+ import WorkflowTile from "./WorkflowTile";
2
+
3
+ export default WorkflowTile;