@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,143 @@
1
+ import React from "react";
2
+ import styled, { css } from "styled-components";
3
+ import { fallbackValues } from "./Checkbox.theme";
4
+ import { noop } from "../../../util/general";
5
+ import Box from "../layouts/Box";
6
+ import Text from "../text";
7
+ import { themeComponent } from "../../../util/themeUtils";
8
+
9
+ const CheckboxContainer = styled.div`
10
+ display: inline-block;
11
+ vertical-align: middle;
12
+ `;
13
+
14
+ const CheckboxLabelContainer = styled.label`
15
+ display: flex;
16
+ align-items: center;
17
+ `;
18
+
19
+ const CheckboxIcon = styled.svg`
20
+ fill: none;
21
+ stroke-width: 2px;
22
+ stroke: ${({ disabled, disabledCheckColor, checkColor }) =>
23
+ disabled
24
+ ? css`
25
+ ${disabledCheckColor}
26
+ `
27
+ : css`
28
+ ${checkColor}
29
+ `};
30
+ `;
31
+
32
+ const HiddenCheckbox = styled.input.attrs({ type: "checkbox" })`
33
+ border: 0;
34
+ clip: rect(0 0 0 0);
35
+ clippath: inset(50%);
36
+ height: 1px;
37
+ margin: -1px;
38
+ overflow: hidden;
39
+ padding: 0;
40
+ position: absolute;
41
+ white-space: nowrap;
42
+ width: 1px;
43
+ `;
44
+
45
+ const StyledCheckbox = styled.div`
46
+ display: inline-block;
47
+ width: 24px;
48
+ height: 24px;
49
+ border-radius: 2px;
50
+ transition: all 150ms;
51
+
52
+ ${CheckboxIcon} {
53
+ visibility: ${({ checked }) => (checked ? "visible" : "hidden")};
54
+ }
55
+
56
+ ${({
57
+ error,
58
+ disabled,
59
+ checked,
60
+ focused,
61
+ defaultStyles,
62
+ checkedStyles,
63
+ focusedStyles,
64
+ errorStyles,
65
+ disabledStyles
66
+ }) =>
67
+ error
68
+ ? css`
69
+ ${errorStyles} ${focused && focusedStyles}
70
+ `
71
+ : disabled
72
+ ? css`
73
+ ${disabledStyles}
74
+ `
75
+ : checked
76
+ ? css`
77
+ ${checkedStyles} ${focused && focusedStyles}
78
+ `
79
+ : css`
80
+ ${defaultStyles} ${focused && focusedStyles}
81
+ `};
82
+ `;
83
+
84
+ const Checkbox = ({
85
+ title,
86
+ name,
87
+ checked,
88
+ onChange = noop,
89
+ disabled = false,
90
+ focused = false,
91
+ themeValues,
92
+ hidden = false,
93
+ error = false
94
+ }) => (
95
+ <Box
96
+ padding="0"
97
+ hiddenStyles={hidden}
98
+ background={themeValues.backgroundColor}
99
+ >
100
+ <CheckboxLabelContainer>
101
+ <CheckboxContainer data-qa="Checkbox">
102
+ <HiddenCheckbox
103
+ id={`checkbox-${name}`}
104
+ disabled={disabled}
105
+ name={name}
106
+ checked={checked}
107
+ onChange={onChange}
108
+ tabIndex="-1"
109
+ />
110
+ <StyledCheckbox
111
+ error={error}
112
+ disabled={disabled}
113
+ checked={checked}
114
+ focused={focused}
115
+ defaultStyles={themeValues.defaultStyles}
116
+ checkedStyles={themeValues.checkedStyles}
117
+ errorStyles={themeValues.errorStyles}
118
+ disabledStyles={themeValues.disabledStyles}
119
+ focusedStyles={themeValues.focusedStyles}
120
+ >
121
+ <CheckboxIcon
122
+ viewBox="0 0 24 24"
123
+ disabled={disabled}
124
+ disabledCheckColor={themeValues.disabledCheckColor}
125
+ checkColor={themeValues.checkColor}
126
+ >
127
+ <polyline points="20 6 9 17 4 12" />
128
+ </CheckboxIcon>
129
+ </StyledCheckbox>
130
+ </CheckboxContainer>
131
+ <Text
132
+ variant="pL"
133
+ weight={themeValues.textFontWeight}
134
+ color={themeValues.textColor}
135
+ extraStyles={`margin-left: 0.5rem`}
136
+ >
137
+ {title}
138
+ </Text>
139
+ </CheckboxLabelContainer>
140
+ </Box>
141
+ );
142
+
143
+ export default themeComponent(Checkbox, "Checkbox", fallbackValues, "default");
@@ -0,0 +1,54 @@
1
+ import {
2
+ WHITE,
3
+ TRANSPARENT,
4
+ GHOST_GREY,
5
+ STORM_GREY,
6
+ SEASHELL_WHITE,
7
+ MATISSE_BLUE,
8
+ RED
9
+ } from "../../../constants/colors";
10
+
11
+ const backgroundColor = { default: `${TRANSPARENT}` };
12
+ const textFontSize = { default: "1.1rem" };
13
+ const textFontWeight = { default: "400" };
14
+ const textLineHeight = { default: "2rem" };
15
+ const textColor = { default: `${STORM_GREY}` };
16
+ const disabledCheckColor = { default: `${GHOST_GREY};` };
17
+ const checkColor = { default: `${WHITE};` };
18
+ const errorStyles = { default: `border: 1px solid ${RED};` };
19
+ const focusedStyles = {
20
+ default: `box-shadow: 0 0 5px 0 ${MATISSE_BLUE};`
21
+ };
22
+ const disabledStyles = {
23
+ default: `
24
+ background: ${SEASHELL_WHITE};
25
+ border: 1px solid ${GHOST_GREY};
26
+ `
27
+ };
28
+ const checkedStyles = {
29
+ default: `
30
+ background: ${MATISSE_BLUE};
31
+ border: 1px solid ${MATISSE_BLUE};
32
+ `
33
+ };
34
+ const defaultStyles = {
35
+ default: `
36
+ background: ${WHITE};
37
+ border: 1px solid ${GHOST_GREY};
38
+ `
39
+ };
40
+
41
+ export const fallbackValues = {
42
+ backgroundColor,
43
+ textFontSize,
44
+ textFontWeight,
45
+ textLineHeight,
46
+ textColor,
47
+ disabledCheckColor,
48
+ checkColor,
49
+ errorStyles,
50
+ focusedStyles,
51
+ disabledStyles,
52
+ checkedStyles,
53
+ defaultStyles
54
+ };
@@ -0,0 +1,3 @@
1
+ import Checkbox from "./Checkbox";
2
+
3
+ export default Checkbox;
@@ -0,0 +1,129 @@
1
+ import React from "react";
2
+ import styled, { ThemeProvider } from "styled-components";
3
+ import { fallbackValues } from "./CheckboxList.theme";
4
+ import { themeComponent } from "../../../util/themeUtils";
5
+ import { RadioButton } from "../../../deprecated";
6
+ import Text from "../text";
7
+ import { noop } from "../../../util/general";
8
+ import { Box, Cluster, Switcher } from "../layouts";
9
+
10
+ export const CheckboxItemIcon = styled.img`
11
+ width: 2rem;
12
+ `;
13
+
14
+ const HiddenCheckboxInput = styled.input`
15
+ opacity: 0;
16
+ position: absolute;
17
+ z-index: -2;
18
+ cursor: pointer;
19
+ `;
20
+
21
+ const CheckboxLabel = styled.label`
22
+ position: relative;
23
+ z-index: 5;
24
+ &:focus {
25
+ outline: none;
26
+ }
27
+ `;
28
+
29
+ const CheckboxListItem = ({
30
+ text,
31
+ render,
32
+ isSelected,
33
+ onSelect,
34
+ index,
35
+ name,
36
+ imageUrl,
37
+ image,
38
+ disabled,
39
+ borderColor,
40
+ color,
41
+ background,
42
+ radioButtonActive,
43
+ radioButtonInactive
44
+ }) => (
45
+ <Box
46
+ padding="0.875rem"
47
+ borderRadius="4px"
48
+ minWidth="30%"
49
+ onClick={disabled ? noop : onSelect}
50
+ borderColor={borderColor}
51
+ borderSize="1px"
52
+ color={color}
53
+ background={background}
54
+ extraStyles={`cursor: pointer;`}
55
+ >
56
+ <Cluster justify="flex-start" align="center">
57
+ <HiddenCheckboxInput id={`checkbox-${name}-${index}`} />
58
+ <CheckboxLabel
59
+ name={name}
60
+ htmlFor={`checkbox-${name}-${index}`}
61
+ onClick={disabled ? noop : onSelect}
62
+ onKeyDown={disabled ? noop : onSelect}
63
+ tabIndex={0}
64
+ >
65
+ <ThemeProvider
66
+ theme={{
67
+ accentColor: radioButtonActive,
68
+ inactiveColor: radioButtonInactive
69
+ }}
70
+ >
71
+ <RadioButton name={name} isSelected={isSelected} />
72
+ </ThemeProvider>
73
+ </CheckboxLabel>
74
+ <Box padding="0rem 0.5rem 0rem 0rem" hiddenStyles={!imageUrl}>
75
+ <Cluster justify="flex-start" align="center">
76
+ <CheckboxItemIcon src={imageUrl} />
77
+ </Cluster>
78
+ </Box>
79
+ <Box padding="0rem 0.5rem 0rem 0rem" hiddenStyles={!image}>
80
+ <Cluster justify="flex-start" align="center">
81
+ {image}
82
+ </Cluster>
83
+ </Box>
84
+ <Text variant="p" isSelected={isSelected}>
85
+ {text ? text : render()}
86
+ </Text>
87
+ </Cluster>
88
+ </Box>
89
+ );
90
+
91
+ const CheckboxList = ({
92
+ items,
93
+ selectedName,
94
+ onSelect,
95
+ variant,
96
+ breakpoint = "30rem",
97
+ themeValues
98
+ }) => (
99
+ <Box padding="0rem" background={themeValues.listBackgroundColor}>
100
+ <Switcher childGap="0.5rem" breakpoint={breakpoint} maxChildren={0}>
101
+ {items.map((item, index) => (
102
+ <CheckboxListItem
103
+ color={themeValues.listItemColor}
104
+ background={themeValues.listItemBackgroundColor}
105
+ borderColor={themeValues.listItemBorderColor}
106
+ key={`checkbox-item-${item.name}`}
107
+ text={item.text}
108
+ render={item.render}
109
+ isSelected={item.name === selectedName}
110
+ onSelect={evt => onSelect(evt, item)}
111
+ index={index}
112
+ imageUrl={item.imageUrl}
113
+ image={item.image}
114
+ name={item.name}
115
+ disabled={variant === "disabled"}
116
+ radioButtonActive={themeValues.radioButtonActive}
117
+ radioButtonInactive={themeValues.radioButtonInactive}
118
+ />
119
+ ))}
120
+ </Switcher>
121
+ </Box>
122
+ );
123
+
124
+ export default themeComponent(
125
+ CheckboxList,
126
+ "CheckboxList",
127
+ fallbackValues,
128
+ "default"
129
+ );
@@ -0,0 +1,42 @@
1
+ import {
2
+ WHITE,
3
+ ATHENS_GREY,
4
+ STORM_GREY,
5
+ MINESHAFT_GREY,
6
+ GHOST_GREY,
7
+ BOSTON_BLUE
8
+ } from "../../../constants/colors";
9
+
10
+ const listBackgroundColor = {
11
+ default: `${ATHENS_GREY}`,
12
+ disabled: `${WHITE}`
13
+ };
14
+ const listItemColor = {
15
+ default: `${MINESHAFT_GREY}`,
16
+ disabled: `${STORM_GREY}`
17
+ };
18
+ const listItemBackgroundColor = {
19
+ default: `${WHITE}`,
20
+ disabled: `${ATHENS_GREY}`
21
+ };
22
+ const listItemBorderColor = {
23
+ default: `${GHOST_GREY}`,
24
+ disabled: `${GHOST_GREY}`
25
+ };
26
+ const radioButtonActive = {
27
+ default: `${BOSTON_BLUE}`,
28
+ disabled: `${GHOST_GREY}`
29
+ };
30
+ const radioButtonInactive = {
31
+ default: `${GHOST_GREY}`,
32
+ disabled: `${GHOST_GREY}`
33
+ };
34
+
35
+ export const fallbackValues = {
36
+ listBackgroundColor,
37
+ listItemColor,
38
+ listItemBackgroundColor,
39
+ listItemBorderColor,
40
+ radioButtonActive,
41
+ radioButtonInactive
42
+ };
@@ -0,0 +1,3 @@
1
+ import CheckboxList from "./CheckboxList";
2
+
3
+ export default CheckboxList;
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+
3
+ import FormSelect from "../form-select";
4
+ import { options } from "./options";
5
+
6
+ const CountryDropdown = ({
7
+ labelTextWhenNoError,
8
+ errorMessages,
9
+ field,
10
+ fieldActions,
11
+ showErrors,
12
+ onChange
13
+ }) => (
14
+ <FormSelect
15
+ options={options}
16
+ field={field}
17
+ fieldActions={fieldActions}
18
+ labelTextWhenNoError={labelTextWhenNoError}
19
+ errorMessages={errorMessages}
20
+ showErrors={showErrors}
21
+ onChange={onChange}
22
+ />
23
+ );
24
+ export default CountryDropdown;
@@ -0,0 +1 @@
1
+ export { default } from "./CountryDropdown";
@@ -0,0 +1,249 @@
1
+ export const options = [
2
+ { text: "Afghanistan", value: "AF" },
3
+ { text: "Aland Islands", value: "AX" },
4
+ { text: "Albania", value: "AL" },
5
+ { text: "Algeria", value: "DZ" },
6
+ { text: "American Samoa", value: "AS" },
7
+ { text: "Andorra", value: "AD" },
8
+ { text: "Angola", value: "AO" },
9
+ { text: "Anguilla", value: "AI" },
10
+ { text: "Antarctica", value: "AQ" },
11
+ { text: "Antigua and Barbuda", value: "AG" },
12
+ { text: "Argentina", value: "AR" },
13
+ { text: "Armenia", value: "AM" },
14
+ { text: "Aruba", value: "AW" },
15
+ { text: "Australia", value: "AU" },
16
+ { text: "Austria", value: "AT" },
17
+ { text: "Azerbaijan", value: "AZ" },
18
+ { text: "Bahamas", value: "BS" },
19
+ { text: "Bahrain", value: "BH" },
20
+ { text: "Bangladesh", value: "BD" },
21
+ { text: "Barbados", value: "BB" },
22
+ { text: "Belarus", value: "BY" },
23
+ { text: "Belgium", value: "BE" },
24
+ { text: "Belize", value: "BZ" },
25
+ { text: "Benin", value: "BJ" },
26
+ { text: "Bermuda", value: "BM" },
27
+ { text: "Bhutan", value: "BT" },
28
+ { text: "Bolivia", value: "BO" },
29
+ { text: "Bosnia and Herzegovina", value: "BA" },
30
+ { text: "Botswana", value: "BW" },
31
+ { text: "Bouvet Island", value: "BV" },
32
+ { text: "Brazil", value: "BR" },
33
+ { text: "British Virgin Islands", value: "VG" },
34
+ { text: "British Indian Ocean Territory", value: "IO" },
35
+ { text: "Brunei Darussalam", value: "BN" },
36
+ { text: "Bulgaria", value: "BG" },
37
+ { text: "Burkina Faso", value: "BF" },
38
+ { text: "Burundi", value: "BI" },
39
+ { text: "Cambodia", value: "KH" },
40
+ { text: "Cameroon", value: "CM" },
41
+ { text: "Canada", value: "CA" },
42
+ { text: "Cape Verde", value: "CV" },
43
+ { text: "Cayman Islands", value: "KY" },
44
+ { text: "Central African Republic", value: "CF" },
45
+ { text: "Chad", value: "TD" },
46
+ { text: "Chile", value: "CL" },
47
+ { text: "China", value: "CN" },
48
+ { text: "Hong Kong, SAR China", value: "HK" },
49
+ { text: "Macao, SAR China", value: "MO" },
50
+ { text: "Christmas Island", value: "CX" },
51
+ { text: "Cocos (Keeling) Islands", value: "CC" },
52
+ { text: "Colombia", value: "CO" },
53
+ { text: "Comoros", value: "KM" },
54
+ { text: "Congo, (Brazzaville)", value: "CG" },
55
+ { text: "Congo, (Kinshasa)", value: "CD" },
56
+ { text: "Cook Islands", value: "CK" },
57
+ { text: "Costa Rica", value: "CR" },
58
+ { text: "Côte d'Ivoire", value: "CI" },
59
+ { text: "Croatia", value: "HR" },
60
+ { text: "Cuba", value: "CU" },
61
+ { text: "Cyprus", value: "CY" },
62
+ { text: "Czech Republic", value: "CZ" },
63
+ { text: "Denmark", value: "DK" },
64
+ { text: "Djibouti", value: "DJ" },
65
+ { text: "Dominica", value: "DM" },
66
+ { text: "Dominican Republic", value: "DO" },
67
+ { text: "Ecuador", value: "EC" },
68
+ { text: "Egypt", value: "EG" },
69
+ { text: "El Salvador", value: "SV" },
70
+ { text: "Equatorial Guinea", value: "GQ" },
71
+ { text: "Eritrea", value: "ER" },
72
+ { text: "Estonia", value: "EE" },
73
+ { text: "Ethiopia", value: "ET" },
74
+ { text: "Falkland Islands (Malvinas)", value: "FK" },
75
+ { text: "Faroe Islands", value: "FO" },
76
+ { text: "Fiji", value: "FJ" },
77
+ { text: "Finland", value: "FI" },
78
+ { text: "France", value: "FR" },
79
+ { text: "French Guiana", value: "GF" },
80
+ { text: "French Polynesia", value: "PF" },
81
+ { text: "French Southern Territories", value: "TF" },
82
+ { text: "Gabon", value: "GA" },
83
+ { text: "Gambia", value: "GM" },
84
+ { text: "Georgia", value: "GE" },
85
+ { text: "Germany", value: "DE" },
86
+ { text: "Ghana", value: "GH" },
87
+ { text: "Gibraltar", value: "GI" },
88
+ { text: "Greece", value: "GR" },
89
+ { text: "Greenland", value: "GL" },
90
+ { text: "Grenada", value: "GD" },
91
+ { text: "Guadeloupe", value: "GP" },
92
+ { text: "Guam", value: "GU" },
93
+ { text: "Guatemala", value: "GT" },
94
+ { text: "Guernsey", value: "GG" },
95
+ { text: "Guinea", value: "GN" },
96
+ { text: "Guinea-Bissau", value: "GW" },
97
+ { text: "Guyana", value: "GY" },
98
+ { text: "Haiti", value: "HT" },
99
+ { text: "Heard and Mcdonald Islands", value: "HM" },
100
+ { text: "Holy See (Vatican City State)", value: "VA" },
101
+ { text: "Honduras", value: "HN" },
102
+ { text: "Hungary", value: "HU" },
103
+ { text: "Iceland", value: "IS" },
104
+ { text: "India", value: "IN" },
105
+ { text: "Indonesia", value: "ID" },
106
+ { text: "Iran, Islamic Republic of", value: "IR" },
107
+ { text: "Iraq", value: "IQ" },
108
+ { text: "Ireland", value: "IE" },
109
+ { text: "Isle of Man", value: "IM" },
110
+ { text: "Israel", value: "IL" },
111
+ { text: "Italy", value: "IT" },
112
+ { text: "Jamaica", value: "JM" },
113
+ { text: "Japan", value: "JP" },
114
+ { text: "Jersey", value: "JE" },
115
+ { text: "Jordan", value: "JO" },
116
+ { text: "Kazakhstan", value: "KZ" },
117
+ { text: "Kenya", value: "KE" },
118
+ { text: "Kiribati", value: "KI" },
119
+ { text: "Korea (North)", value: "KP" },
120
+ { text: "Korea (South)", value: "KR" },
121
+ { text: "Kuwait", value: "KW" },
122
+ { text: "Kyrgyzstan", value: "KG" },
123
+ { text: "Lao PDR", value: "LA" },
124
+ { text: "Latvia", value: "LV" },
125
+ { text: "Lebanon", value: "LB" },
126
+ { text: "Lesotho", value: "LS" },
127
+ { text: "Liberia", value: "LR" },
128
+ { text: "Libya", value: "LY" },
129
+ { text: "Liechtenstein", value: "LI" },
130
+ { text: "Lithuania", value: "LT" },
131
+ { text: "Luxembourg", value: "LU" },
132
+ { text: "Macedonia, Republic of", value: "MK" },
133
+ { text: "Madagascar", value: "MG" },
134
+ { text: "Malawi", value: "MW" },
135
+ { text: "Malaysia", value: "MY" },
136
+ { text: "Maldives", value: "MV" },
137
+ { text: "Mali", value: "ML" },
138
+ { text: "Malta", value: "MT" },
139
+ { text: "Marshall Islands", value: "MH" },
140
+ { text: "Martinique", value: "MQ" },
141
+ { text: "Mauritania", value: "MR" },
142
+ { text: "Mauritius", value: "MU" },
143
+ { text: "Mayotte", value: "YT" },
144
+ { text: "Mexico", value: "MX" },
145
+ { text: "Micronesia, Federated States of", value: "FM" },
146
+ { text: "Moldova", value: "MD" },
147
+ { text: "Monaco", value: "MC" },
148
+ { text: "Mongolia", value: "MN" },
149
+ { text: "Montenegro", value: "ME" },
150
+ { text: "Montserrat", value: "MS" },
151
+ { text: "Morocco", value: "MA" },
152
+ { text: "Mozambique", value: "MZ" },
153
+ { text: "Myanmar", value: "MM" },
154
+ { text: "Namibia", value: "NA" },
155
+ { text: "Nauru", value: "NR" },
156
+ { text: "Nepal", value: "NP" },
157
+ { text: "Netherlands", value: "NL" },
158
+ { text: "Netherlands Antilles", value: "AN" },
159
+ { text: "New Caledonia", value: "NC" },
160
+ { text: "New Zealand", value: "NZ" },
161
+ { text: "Nicaragua", value: "NI" },
162
+ { text: "Niger", value: "NE" },
163
+ { text: "Nigeria", value: "NG" },
164
+ { text: "Niue", value: "NU" },
165
+ { text: "Norfolk Island", value: "NF" },
166
+ { text: "Northern Mariana Islands", value: "MP" },
167
+ { text: "Norway", value: "NO" },
168
+ { text: "Oman", value: "OM" },
169
+ { text: "Pakistan", value: "PK" },
170
+ { text: "Palau", value: "PW" },
171
+ { text: "Palestinian Territory", value: "PS" },
172
+ { text: "Panama", value: "PA" },
173
+ { text: "Papua New Guinea", value: "PG" },
174
+ { text: "Paraguay", value: "PY" },
175
+ { text: "Peru", value: "PE" },
176
+ { text: "Philippines", value: "PH" },
177
+ { text: "Pitcairn", value: "PN" },
178
+ { text: "Poland", value: "PL" },
179
+ { text: "Portugal", value: "PT" },
180
+ { text: "Puerto Rico", value: "PR" },
181
+ { text: "Qatar", value: "QA" },
182
+ { text: "Réunion", value: "RE" },
183
+ { text: "Romania", value: "RO" },
184
+ { text: "Russian Federation", value: "RU" },
185
+ { text: "Rwanda", value: "RW" },
186
+ { text: "Saint-Barthélemy", value: "BL" },
187
+ { text: "Saint Helena", value: "SH" },
188
+ { text: "Saint Kitts and Nevis", value: "KN" },
189
+ { text: "Saint Lucia", value: "LC" },
190
+ { text: "Saint-Martin (French part)", value: "MF" },
191
+ { text: "Saint Pierre and Miquelon", value: "PM" },
192
+ { text: "Saint Vincent and Grenadines", value: "VC" },
193
+ { text: "Samoa", value: "WS" },
194
+ { text: "San Marino", value: "SM" },
195
+ { text: "Sao Tome and Principe", value: "ST" },
196
+ { text: "Saudi Arabia", value: "SA" },
197
+ { text: "Senegal", value: "SN" },
198
+ { text: "Serbia", value: "RS" },
199
+ { text: "Seychelles", value: "SC" },
200
+ { text: "Sierra Leone", value: "SL" },
201
+ { text: "Singapore", value: "SG" },
202
+ { text: "Slovakia", value: "SK" },
203
+ { text: "Slovenia", value: "SI" },
204
+ { text: "Solomon Islands", value: "SB" },
205
+ { text: "Somalia", value: "SO" },
206
+ { text: "South Africa", value: "ZA" },
207
+ { text: "South Georgia and the South Sandwich Islands", value: "GS" },
208
+ { text: "South Sudan", value: "SS" },
209
+ { text: "Spain", value: "ES" },
210
+ { text: "Sri Lanka", value: "LK" },
211
+ { text: "Sudan", value: "SD" },
212
+ { text: "Suriname", value: "SR" },
213
+ { text: "Svalbard and Jan Mayen Islands", value: "SJ" },
214
+ { text: "Swaziland", value: "SZ" },
215
+ { text: "Sweden", value: "SE" },
216
+ { text: "Switzerland", value: "CH" },
217
+ { text: "Syrian Arab Republic (Syria)", value: "SY" },
218
+ { text: "Taiwan, Republic of China", value: "TW" },
219
+ { text: "Tajikistan", value: "TJ" },
220
+ { text: "Tanzania, United Republic of", value: "TZ" },
221
+ { text: "Thailand", value: "TH" },
222
+ { text: "Timor-Leste", value: "TL" },
223
+ { text: "Togo", value: "TG" },
224
+ { text: "Tokelau", value: "TK" },
225
+ { text: "Tonga", value: "TO" },
226
+ { text: "Trinidad and Tobago", value: "TT" },
227
+ { text: "Tunisia", value: "TN" },
228
+ { text: "Turkey", value: "TR" },
229
+ { text: "Turkmenistan", value: "TM" },
230
+ { text: "Turks and Caicos Islands", value: "TC" },
231
+ { text: "Tuvalu", value: "TV" },
232
+ { text: "Uganda", value: "UG" },
233
+ { text: "Ukraine", value: "UA" },
234
+ { text: "United Arab Emirates", value: "AE" },
235
+ { text: "United Kingdom", value: "GB" },
236
+ { text: "United States of America", value: "US" },
237
+ { text: "US Minor Outlying Islands", value: "UM" },
238
+ { text: "Uruguay", value: "UY" },
239
+ { text: "Uzbekistan", value: "UZ" },
240
+ { text: "Vanuatu", value: "VU" },
241
+ { text: "Venezuela (Bolivarian Republic)", value: "VE" },
242
+ { text: "Viet Nam", value: "VN" },
243
+ { text: "Virgin Islands, US", value: "VI" },
244
+ { text: "Wallis and Futuna Islands", value: "WF" },
245
+ { text: "Western Sahara", value: "EH" },
246
+ { text: "Yemen", value: "YE" },
247
+ { text: "Zambia", value: "ZM" },
248
+ { text: "Zimbabwe", value: "ZW" }
249
+ ];
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import Box from "../layouts/Box";
3
+ import { fallbackValues } from "./DisplayBox.theme";
4
+ import { themeComponent } from "../../../util/themeUtils";
5
+ import { RED } from "../../../constants/colors";
6
+
7
+ const DisplayBox = ({ children, themeValues, showError }) => (
8
+ <Box padding="0.5rem 0 1.5rem 0">
9
+ <Box
10
+ padding="1.5rem"
11
+ background={themeValues.backgroundColor}
12
+ borderSize={showError && "1px"}
13
+ borderColor={showError && RED}
14
+ borderRadius="4px"
15
+ boxShadow={themeValues.boxShadow}
16
+ >
17
+ {children}
18
+ </Box>
19
+ </Box>
20
+ );
21
+
22
+ export default themeComponent(DisplayBox, "DisplayBox", fallbackValues);
@@ -0,0 +1,9 @@
1
+ import { GHOST_GREY, ATHENS_GREY, WHITE } from "../../../constants/colors";
2
+
3
+ const backgroundColor = WHITE;
4
+ const boxShadow = `0px 2px 14px 0px ${ATHENS_GREY}, 0px 3px 8px 0px ${GHOST_GREY}`;
5
+
6
+ export const fallbackValues = {
7
+ backgroundColor,
8
+ boxShadow
9
+ };