@stokr/components-library 0.5.4 → 0.5.6

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 (434) hide show
  1. package/build/asset-manifest.json +9 -0
  2. package/build/favicon.ico +0 -0
  3. package/build/index.html +1 -0
  4. package/build/logo192.png +0 -0
  5. package/build/logo512.png +0 -0
  6. package/build/manifest.json +25 -0
  7. package/build/robots.txt +3 -0
  8. package/build/static/js/main.31d6cfe0.js +0 -0
  9. package/dist/AccountBalance/AccountBalance.js +43 -0
  10. package/dist/AccountBalance/AccountBalance.stories.js +75 -0
  11. package/dist/AccountBalance/AccountBalance.styles.js +38 -0
  12. package/dist/AdminDashboard/Table/Table.js +120 -0
  13. package/dist/AdminDashboard/Table/Table.styles.js +111 -0
  14. package/dist/AgreementItem/AgreementItem.js +38 -0
  15. package/dist/AgreementItem/AgreementItem.stories.js +98 -0
  16. package/dist/AgreementItem/AgreementItem.styles.js +31 -0
  17. package/dist/AnalyticGraphs/Analytic.js +528 -0
  18. package/dist/AnalyticGraphs/Analytic.styles.js +49 -0
  19. package/dist/BackButton/BackButton.js +22 -0
  20. package/dist/BackButton/BackButton.stories.js +24 -0
  21. package/dist/BackButton/BackButton.styles.js +110 -0
  22. package/dist/Background/Background.js +34 -0
  23. package/dist/Background/Background.stories.js +50 -0
  24. package/dist/Background/Background.styles.js +113 -0
  25. package/dist/BarChart/BarChart.js +258 -0
  26. package/dist/BarChart/BarChart.stories.js +46 -0
  27. package/dist/BarChart/BarChart.styles.js +93 -0
  28. package/dist/BarChartLegend/BarChartLegend.js +74 -0
  29. package/dist/BarChartLegend/BarChartLegend.styles.js +26 -0
  30. package/dist/BasicTable/BasicTable.js +20 -0
  31. package/dist/BasicTable/BasicTable.stories.js +51 -0
  32. package/dist/BasicTable/BasicTable.styles.js +64 -0
  33. package/dist/Button/Button.stories.js +63 -0
  34. package/dist/Button/Button.styles.js +180 -0
  35. package/dist/ButtonContainer/ButtonContainer.styles.js +25 -0
  36. package/dist/CapitalRaisedSummary/CapitalRaisedSummery.stories.js +35 -0
  37. package/dist/CapitalRaisedSummary/CaptialRaisedSummary.js +23 -0
  38. package/dist/CapitalRaisedSummary/CaptialRaisedSummary.styles.js +36 -0
  39. package/dist/ChartBox/ChartBox.js +34 -0
  40. package/dist/ChartBox/ChartBox.stories.js +9 -0
  41. package/dist/ChartBox/ChartBox.styles.js +50 -0
  42. package/dist/ChartBox/ChartBoxDistribution.js +20 -0
  43. package/dist/ChartBox/ChartBoxDistribution.stories.js +10 -0
  44. package/dist/ChartLegend/ChartLegend.js +37 -0
  45. package/dist/ChartLegend/ChartLegend.stories.js +74 -0
  46. package/dist/ChartLegend/ChartLegend.styles.js +67 -0
  47. package/dist/Checkbox/Checkbox.js +108 -0
  48. package/dist/Checkbox/Checkbox.stories.js +82 -0
  49. package/dist/Checkbox/Checkbox.styles.js +123 -0
  50. package/dist/Checklist/UserChecklist.js +247 -0
  51. package/dist/Checklist/UserChecklist.stories.js +115 -0
  52. package/dist/ComponentScroll/ComponentScroll.js +99 -0
  53. package/dist/ComponentScroll/ComponentScroll.stories.js +92 -0
  54. package/dist/ComponentScroll/ComponentScroll.styles.js +104 -0
  55. package/dist/ComponentWrapper/ComponentWrapper.styles.js +128 -0
  56. package/dist/CryptoAddress/ComponentWrap.js +24 -0
  57. package/dist/CryptoAddress/CryptoAddress.js +124 -0
  58. package/dist/CryptoAddress/CryptoAddress.stories.js +163 -0
  59. package/dist/CryptoAddress/CryptoAddress.styles.js +399 -0
  60. package/dist/CryptoAddress/RadioWrap.js +36 -0
  61. package/dist/CryptoAddressDetails/CryptoAddressDetails.js +42 -0
  62. package/dist/CryptoAddressDetails/CryptoAddressDetails.stories.js +65 -0
  63. package/dist/CryptoAddressDetails/CryptoAddressDetails.styles.js +114 -0
  64. package/dist/CryptoAddressWrapper/CryptoAddressWrapper.js +30 -0
  65. package/dist/CryptoAddressWrapper/CryptoAddressWrapper.styles.js +98 -0
  66. package/dist/DonutChart/DonutChart.js +137 -0
  67. package/dist/DonutChart/DonutChart.stories.js +39 -0
  68. package/dist/DonutChart/DonutChart.styles.js +101 -0
  69. package/dist/DoubleButton/DoubleButton.styles.js +25 -0
  70. package/dist/ErrorMessage/ErrorMessage.styles.js +9 -0
  71. package/dist/FAQ/FAQ.js +40 -0
  72. package/dist/FAQ/FAQ.stories.js +63 -0
  73. package/dist/FAQ/FAQ.styles.js +69 -0
  74. package/dist/Footer/Footer.js +54 -0
  75. package/dist/Footer/Footer.stories.js +41 -0
  76. package/dist/Footer/Footer.styles.js +230 -0
  77. package/dist/Footer/FooterLayout.js +114 -0
  78. package/dist/Footer/FooterLayout.stories.js +20 -0
  79. package/dist/Footer/FooterMenu.js +83 -0
  80. package/dist/Footer/FooterMenu.stories.js +110 -0
  81. package/dist/Footer/FooterMenu.styles.js +274 -0
  82. package/dist/Footer/index.js +4 -0
  83. package/dist/{03f9f978feb2b015b6812ba10f689967.png → Footer/lemonway.png} +0 -0
  84. package/dist/Footer/sicos-logo.svg +1 -0
  85. package/dist/ForgotPasswordModal/ForgotPasswordModal.js +89 -0
  86. package/dist/ForgotPasswordModal/ForgotPasswordModal.stories.js +31 -0
  87. package/dist/Form/Form.js +38 -0
  88. package/dist/Form/Form.stories.js +23 -0
  89. package/dist/Form/Form.styles.js +66 -0
  90. package/dist/FullscreenCard/FullscreenCard.styles.js +36 -0
  91. package/dist/Grid/Grid.styles.js +109 -0
  92. package/dist/Header/Header.js +369 -0
  93. package/dist/Header/Header.stories.js +172 -0
  94. package/dist/Header/Header.styles.js +493 -0
  95. package/dist/Icon/Icon.style.js +75 -0
  96. package/dist/InfoIcon/InfoIcon.js +40 -0
  97. package/dist/InfoIcon/InfoIcon.stories.js +40 -0
  98. package/dist/InfoIcon/InfoIcon.styles.js +42 -0
  99. package/dist/InfoPanel/InfoPanel.js +115 -0
  100. package/dist/Input/DatePickerInput.js +64 -0
  101. package/dist/Input/DatePickerInput.stories.js +80 -0
  102. package/dist/Input/DatePickerInput.styles.js +67 -0
  103. package/dist/Input/Input.js +86 -0
  104. package/dist/Input/Input.stories.js +134 -0
  105. package/dist/Input/Input.styles.js +126 -0
  106. package/dist/Input/InputPassword.js +122 -0
  107. package/dist/Input/InputPassword.stories.js +72 -0
  108. package/dist/Input/InputPassword.styles.js +139 -0
  109. package/dist/Input/RangeInput.js +46 -0
  110. package/dist/Input/RangeInput.stories.js +48 -0
  111. package/dist/Input/RangeInput.styles.js +125 -0
  112. package/dist/Input/Select.js +130 -0
  113. package/dist/Input/Select.stories.js +129 -0
  114. package/dist/Input/Select.styles.js +143 -0
  115. package/dist/InvestCalculator/InvestCalculator.js +353 -0
  116. package/dist/InvestCalculator/InvestCalculator.stories.js +129 -0
  117. package/dist/InvestCalculator/InvestCalculator.styles.js +78 -0
  118. package/dist/InvestmentStat/InvestmentStat.js +33 -0
  119. package/dist/InvestmentStat/InvestmentStat.stories.js +44 -0
  120. package/dist/InvestmentStat/InvestmentStat.styles.js +53 -0
  121. package/dist/KYCFlow/BasicInfo.js +396 -0
  122. package/dist/KYCFlow/Confirmation.js +37 -0
  123. package/dist/KYCFlow/DocumentFileUpload.js +240 -0
  124. package/dist/KYCFlow/DocumentScan.js +66 -0
  125. package/dist/KYCFlow/DocumentScanUpload.js +228 -0
  126. package/dist/KYCFlow/DocumentSelect.js +101 -0
  127. package/dist/KYCFlow/DocumentSuccess.js +54 -0
  128. package/dist/KYCFlow/DocumentUpload.js +44 -0
  129. package/dist/KYCFlow/DocumentVerificationType.js +114 -0
  130. package/dist/KYCFlow/FaceScan.js +45 -0
  131. package/dist/KYCFlow/FaceScanRecognition.js +52 -0
  132. package/dist/KYCFlow/FaceScanSuccess.js +47 -0
  133. package/dist/KYCFlow/Terms.js +99 -0
  134. package/dist/KYCFlow/_styles.js +284 -0
  135. package/dist/KYCFlow/index.js +14 -0
  136. package/dist/KYCSelectBox/KYCSelectBox.styles.js +62 -0
  137. package/dist/LatestUpdate/LatestUpdate.js +35 -0
  138. package/dist/LatestUpdate/LatestUpdate.stories.js +51 -0
  139. package/dist/LatestUpdate/LatestUpdate.styles.js +77 -0
  140. package/dist/Layout/Layout-func-no-work.js +67 -0
  141. package/dist/Layout/Layout.js +68 -0
  142. package/dist/Layout/Layout.stories.js +55 -0
  143. package/dist/LearnMoreCarousel/LearnMoreCarousel.js +39 -0
  144. package/dist/LearnMoreCarousel/LearnMoreCarousel.stories.js +58 -0
  145. package/dist/LearnMoreCarousel/LearnMoreCarousel.styles.js +205 -0
  146. package/dist/LearnMorePage/LearnMore.js +199 -0
  147. package/dist/LearnMorePage/LearnMore.shared.styles.js +49 -0
  148. package/dist/LearnMorePage/LearnMore.stories.js +41 -0
  149. package/dist/LearnMorePage/LearnMore.styles.js +250 -0
  150. package/dist/LearnMorePage/LearnMoreExampleObject.js +102 -0
  151. package/dist/LearnMorePage/LearnMoreItem.js +73 -0
  152. package/dist/LearnMorePage/LearnMoreItem.stories.js +54 -0
  153. package/dist/LearnMorePage/LearnMoreItem.styles.js +218 -0
  154. package/dist/LearnMoreSection/LearnMore.js +158 -0
  155. package/dist/LearnMoreSection/LearnMore.stories.js +23 -0
  156. package/dist/LearnMoreSection/LearnMore.styles.js +134 -0
  157. package/dist/LearnMoreSection/LearnMoreItem.js +39 -0
  158. package/dist/LearnMoreSection/LearnMoreItem.stories.js +52 -0
  159. package/dist/LearnMoreSection/LearnMoreItem.styles.js +54 -0
  160. package/dist/LoginModal/LoginModal.js +125 -0
  161. package/dist/MainMenu/DynamicMainMenu.js +41 -0
  162. package/dist/MainMenu/MainMenu.js +207 -0
  163. package/dist/MainMenu/MainMenu.styles.js +361 -0
  164. package/dist/MatomoConnect/Matomo.js +221 -0
  165. package/dist/MatomoConnect/Matomo_fuckup.js +185 -0
  166. package/dist/MenuNav/MenuNav.styles.js +88 -0
  167. package/dist/Modal/Modal.js +71 -0
  168. package/dist/Modal/Modal.stories.js +67 -0
  169. package/dist/Modal/Modal.styles.js +407 -0
  170. package/dist/MultiProgressBar/MultiProgressBar.js +33 -0
  171. package/dist/MultiProgressBar/MultiProgressBar.stories.js +61 -0
  172. package/dist/MultiProgressBar/MultiProgressBar.styles.js +92 -0
  173. package/dist/Newsletter/Newsletter.js +106 -0
  174. package/dist/Newsletter/Newsletter.stories.js +8 -0
  175. package/dist/Newsletter/Newsletter.styles.js +173 -0
  176. package/dist/NotificationContext/NotificationContext.js +126 -0
  177. package/dist/NotificationContext/NotificationContext.stories.js +32 -0
  178. package/dist/NotificationCounter/NotificationCounter.styles.js +23 -0
  179. package/dist/Number/Number.js +25 -0
  180. package/dist/Number/Number.stories.js +18 -0
  181. package/dist/Number/Number.styles.js +21 -0
  182. package/dist/PageTransition/PageTransition.js +42 -0
  183. package/dist/Process/Process.stories.js +34 -0
  184. package/dist/Process/Process.styles.js +87 -0
  185. package/dist/ProfileBadge/ProfileBadge.js +46 -0
  186. package/dist/ProfileBadge/ProfileBadge.stories.js +37 -0
  187. package/dist/ProfileBadge/ProfileBadge.styles.js +47 -0
  188. package/dist/ProfileBox/ProfileBox.js +29 -0
  189. package/dist/ProfileBox/ProfileBox.stories.js +27 -0
  190. package/dist/ProfileBox/ProfileBox.styles.js +60 -0
  191. package/dist/ProfileHeader/ProfileHeader-CLb4.js +401 -0
  192. package/dist/ProfileHeader/ProfileHeader.js +268 -0
  193. package/dist/ProfileHeader/ProfileHeader.styles.js +114 -0
  194. package/dist/ProfileStat/ProfileStat.js +32 -0
  195. package/dist/ProfileStat/ProfileStat.stories.js +58 -0
  196. package/dist/ProfileStat/ProfileStat.styles.js +80 -0
  197. package/dist/ProofOfAddress/ProofOfAddress.styles.js +76 -0
  198. package/dist/ROI/ROI.js +261 -0
  199. package/dist/ROI/ROI.styles.js +71 -0
  200. package/dist/ROI/ROIChart.js +348 -0
  201. package/dist/ROI/ROIChart.styles.js +98 -0
  202. package/dist/ROI/ROIModal.js +74 -0
  203. package/dist/ROI/ROIScenarioBox.js +46 -0
  204. package/dist/ROI/ROIScenarioBox.styles.js +131 -0
  205. package/dist/Radio/Radio.js +58 -0
  206. package/dist/Radio/Radio.stories.js +65 -0
  207. package/dist/Radio/Radio.styles.js +93 -0
  208. package/dist/RefreshButton/RefreshButton.js +14 -0
  209. package/dist/RefreshButton/RefreshButton.stories.js +29 -0
  210. package/dist/RefreshButton/RefreshButton.styles.js +57 -0
  211. package/dist/RegisterAlgorand/AlgoAddressName.js +103 -0
  212. package/dist/RegisterAlgorand/AlgoAdressSelect.js +274 -0
  213. package/dist/RegisterAlgorand/AlgoConnectWallet.js +37 -0
  214. package/dist/RegisterAlgorand/AlgoSuccess.js +28 -0
  215. package/dist/RegisterAlgorand/Algorand.stories.js +61 -0
  216. package/dist/RegisterAlgorand/ChooseWallet.js +77 -0
  217. package/dist/RegisterAlgorand/SelectProject.js +77 -0
  218. package/dist/RegisterAlgorand/_styles.js +30 -0
  219. package/dist/RegisterAlgorand/flow.js +243 -0
  220. package/dist/RegisterAlgorand/flowWithMemo.js +244 -0
  221. package/dist/RegisterAlgorand/index.js +7 -0
  222. package/dist/RegisterConfirmModal/RegisterConfirmModal.js +30 -0
  223. package/dist/RegisterConfirmModal/RegisterConfirmModal.stories.js +22 -0
  224. package/dist/RegisterConfirmModal/RegisterConfirmModal.styles.js +19 -0
  225. package/dist/RegisterEthereum/EthAddressLedger.js +151 -0
  226. package/dist/RegisterEthereum/EthAddressMetamask.js +165 -0
  227. package/dist/RegisterEthereum/EthAddressName.js +101 -0
  228. package/dist/RegisterEthereum/EthConnectLedger.js +117 -0
  229. package/dist/RegisterEthereum/EthConnectMetamask.js +25 -0
  230. package/dist/RegisterEthereum/EthFinish.js +32 -0
  231. package/dist/RegisterEthereum/EthIntro.js +77 -0
  232. package/dist/RegisterEthereum/_styles.js +30 -0
  233. package/dist/RegisterEthereum/index.js +9 -0
  234. package/dist/RegisterLiquidSteps/RegisterLiquidSteps.js +75 -0
  235. package/dist/RegisterLiquidSteps/RegisterLiquidSteps.stories.js +65 -0
  236. package/dist/RegisterLiquidSteps/RegisterLiquidSteps.styles.js +69 -0
  237. package/dist/RegisterLiquidSteps/assets/nav_green.svg +31 -0
  238. package/dist/RegisterLiquidSteps/assets/video.mp4 +0 -0
  239. package/dist/RegisterLiquidSteps/assets/videothumbnail.jpg +0 -0
  240. package/dist/RegisterLiquidSteps/complete.js +29 -0
  241. package/dist/RegisterLiquidSteps/flow.js +141 -0
  242. package/dist/RegisterLiquidSteps/index.js +29 -0
  243. package/dist/RegisterLiquidSteps/register-liquid.js +197 -0
  244. package/dist/RegisterModal/RegisterModal.js +143 -0
  245. package/dist/RegisterModal/RegisterModal.stories.js +35 -0
  246. package/dist/RequestDataBox/RequestDataBox.js +21 -0
  247. package/dist/RequestDataBox/RequestDataBox.stories.js +29 -0
  248. package/dist/RequestDataBox/RequestDataBox.styles.js +40 -0
  249. package/dist/RiskQuestionnaire/RiskQuestionnaireContext.js +111 -0
  250. package/dist/RiskQuestionnaire/_styles.js +6 -0
  251. package/dist/SEO/SEO.js +63 -0
  252. package/dist/SEO/SEO.stories.js +53 -0
  253. package/dist/SectionTitle/SectionTitle.styles.js +23 -0
  254. package/dist/SideLine/SideLine.js +4 -0
  255. package/dist/SideLine/SideLine.stories.js +20 -0
  256. package/dist/SideLine/SideLine.styles.js +29 -0
  257. package/dist/SigningSubflow/SignSubAddressMetamask.js +105 -0
  258. package/dist/SigningSubflow/SignSubConnectLedger.js +114 -0
  259. package/dist/SigningSubflow/SignSubConnectMetamask.js +101 -0
  260. package/dist/SigningSubflow/SignSubIntro.js +45 -0
  261. package/dist/SigningSubflow/SignSubSendLedger.js +114 -0
  262. package/dist/SigningSubflow/SignSubSendMetamask.js +53 -0
  263. package/dist/SigningSubflow/SignSubTransactionLedger.js +125 -0
  264. package/dist/SigningSubflow/SignSubTransactionMetamask.js +130 -0
  265. package/dist/SigningSubflow/_styles.js +59 -0
  266. package/dist/SigningSubflow/index.js +9 -0
  267. package/dist/Slider/Slider.js +43 -0
  268. package/dist/Slider/Slider.stories.js +63 -0
  269. package/dist/Slider/Slider.styles.js +115 -0
  270. package/dist/SpanButton/SpanButton.styles.js +14 -0
  271. package/dist/StatusBadge/StatusBadge.styles.js +16 -0
  272. package/dist/StepController/StepController.js +73 -0
  273. package/dist/StepController/StepController.stories.js +52 -0
  274. package/dist/StepController/StepController.styles.js +27 -0
  275. package/dist/StepController/StepControllerContext.js +61 -0
  276. package/dist/StepController/StepControllerProgress.js +28 -0
  277. package/dist/StepController/StepControllerProgress.stories.js +41 -0
  278. package/dist/StepsProgress/StepsProgress.js +95 -0
  279. package/dist/StepsProgress/StepsProgress.stories.js +23 -0
  280. package/dist/StepsProgress/StepsProgress.styles.js +97 -0
  281. package/dist/StokrLoader/StokrLoader.js +60 -0
  282. package/dist/StokrLoader/media.js +22 -0
  283. package/dist/StokrLoader/stokr_loader_white_400x400.gif +0 -0
  284. package/dist/SvgIcons/AdminBadgeSvg.js +16 -0
  285. package/dist/SvgIcons/CameraSvg.js +26 -0
  286. package/dist/SvgIcons/CapsLockSvg.js +21 -0
  287. package/dist/SvgIcons/DocumentBackSvg.js +25 -0
  288. package/dist/SvgIcons/DocumentSmallSvg.js +51 -0
  289. package/dist/SvgIcons/DocumentSvg.js +28 -0
  290. package/dist/SvgIcons/Early.js +14 -0
  291. package/dist/SvgIcons/EthSvg.js +30 -0
  292. package/dist/SvgIcons/EurSvg.js +16 -0
  293. package/dist/SvgIcons/FaceScanIconSvg.js +21 -0
  294. package/dist/SvgIcons/FourSvg.js +11 -0
  295. package/dist/SvgIcons/Glassess.js +19 -0
  296. package/dist/SvgIcons/Icons_Badge.png +0 -0
  297. package/dist/SvgIcons/LogoSvg.js +14 -0
  298. package/dist/SvgIcons/OneSvg.js +13 -0
  299. package/dist/SvgIcons/PassportSvg.js +46 -0
  300. package/dist/SvgIcons/RefreshSvg.js +17 -0
  301. package/dist/SvgIcons/SocialFacebook.js +15 -0
  302. package/dist/SvgIcons/SocialInstagram.js +15 -0
  303. package/dist/SvgIcons/SocialLinkedIn.js +15 -0
  304. package/dist/SvgIcons/SocialMedium.js +15 -0
  305. package/dist/SvgIcons/SocialReddit.js +15 -0
  306. package/dist/SvgIcons/SocialTelegram.js +15 -0
  307. package/dist/SvgIcons/SocialTwitter.js +15 -0
  308. package/dist/SvgIcons/SocialYoutube.js +15 -0
  309. package/dist/SvgIcons/ThreeSvg.js +10 -0
  310. package/dist/SvgIcons/TwoSidedDocumentSvg.js +72 -0
  311. package/dist/SvgIcons/TwoSvg.js +13 -0
  312. package/dist/SvgIcons/UpdateDefaultSvg.js +19 -0
  313. package/dist/SvgIcons/UpdateHardSvg.js +15 -0
  314. package/dist/SvgIcons/UpdateSoftSvg.js +17 -0
  315. package/dist/SvgIcons/UploadSvg.js +24 -0
  316. package/dist/SvgIcons/VerifiedBadge.js +13 -0
  317. package/dist/SvgIcons/index.js +32 -0
  318. package/dist/Switch/Switch.js +45 -0
  319. package/dist/Switch/Switch.stories.js +73 -0
  320. package/dist/Switch/Switch.styles.js +105 -0
  321. package/dist/Tabs/Tabs.js +48 -0
  322. package/dist/Tabs/Tabs.stories.js +28 -0
  323. package/dist/Tabs/Tabs.styles.js +11 -0
  324. package/dist/TabsNav/TabNav.js +21 -0
  325. package/dist/TabsNav/TabNav.stories.js +32 -0
  326. package/dist/TabsNav/TabsNav.js +23 -0
  327. package/dist/TabsNav/TabsNav.stories.js +25 -0
  328. package/dist/TabsNav/TabsNav.styles.js +80 -0
  329. package/dist/TeamOverview/TeamOverview.js +69 -0
  330. package/dist/TeamOverview/TeamOverview.stories.js +68 -0
  331. package/dist/TeamOverview/TeamOverview.styles.js +152 -0
  332. package/dist/Text/Headline.js +34 -0
  333. package/dist/Text/Headline.stories.js +40 -0
  334. package/dist/Text/StyledText.js +30 -0
  335. package/dist/Text/Text.stories.js +59 -0
  336. package/dist/Text/Text.styles.js +166 -0
  337. package/dist/TextLink/TextLink.styles.js +50 -0
  338. package/dist/ToDoList/ToDoList.js +172 -0
  339. package/dist/ToDoList/ToDoList.stories.js +123 -0
  340. package/dist/ToDoList/ToDoList.styles.js +115 -0
  341. package/dist/ToDoList/ToDoListTask.js +96 -0
  342. package/dist/ToDoList/ToDoListTask.stories.js +60 -0
  343. package/dist/ToDoList/ToDoListTask.styles.js +104 -0
  344. package/dist/TransactionDetails/TransactionDetails.js +27 -0
  345. package/dist/TransactionDetails/TransactionDetails.stories.js +47 -0
  346. package/dist/TransactionDetails/TransactionDetails.styles.js +31 -0
  347. package/dist/TransactionInfo/TransactionInfo.js +48 -0
  348. package/dist/TransactionInfo/TransactionInfo.stories.js +53 -0
  349. package/dist/TransactionInfo/TransactionInfo.styles.js +64 -0
  350. package/dist/TwoFactorModal/TwoFactorModal.js +84 -0
  351. package/dist/breakdown/Breakdown.js +124 -0
  352. package/dist/breakdown/index.js +2 -0
  353. package/dist/context/Auth.js +133 -0
  354. package/dist/context/AuthContext.js +154 -0
  355. package/dist/icons/Arrow.js +62 -0
  356. package/dist/icons/Arrow.stories.js +37 -0
  357. package/dist/icons/ArrowSimple.js +51 -0
  358. package/dist/icons/ArrowSimple.stories.js +41 -0
  359. package/dist/icons/Check.js +29 -0
  360. package/dist/icons/Check.stories.js +14 -0
  361. package/dist/icons/Facebook.js +15 -0
  362. package/dist/icons/Facebook.stories.js +15 -0
  363. package/dist/icons/Info.js +41 -0
  364. package/dist/icons/Info.stories.js +8 -0
  365. package/dist/icons/Instagram.js +15 -0
  366. package/dist/icons/Instagram.stories.js +15 -0
  367. package/dist/icons/LinkIcon.js +23 -0
  368. package/dist/icons/LinkIcon.stories.js +15 -0
  369. package/dist/icons/LinkedIn.js +29 -0
  370. package/dist/icons/LinkedIn.stories.js +8 -0
  371. package/dist/icons/Medium.js +28 -0
  372. package/dist/icons/Medium.stories.js +8 -0
  373. package/dist/icons/Reddit.js +18 -0
  374. package/dist/icons/Reddit.stories.js +15 -0
  375. package/dist/icons/Share.js +48 -0
  376. package/dist/icons/Share.stories.js +8 -0
  377. package/dist/icons/Telegram.js +28 -0
  378. package/dist/icons/Telegram.stories.js +8 -0
  379. package/dist/icons/Twitter.js +15 -0
  380. package/dist/icons/Twitter.stories.js +15 -0
  381. package/dist/icons/X.js +15 -0
  382. package/dist/icons/X.stories.js +8 -0
  383. package/dist/icons/Youtube.js +15 -0
  384. package/dist/icons/Youtube.stories.js +15 -0
  385. package/dist/icons/index.js +15 -0
  386. package/dist/index.js +177 -1
  387. package/dist/renderToBody/index.js +2 -0
  388. package/dist/renderToBody/renderToBody.js +26 -0
  389. package/dist/taxId/TaxId.stories.js +29 -0
  390. package/dist/taxId/complete.js +21 -0
  391. package/dist/taxId/flow.js +31 -0
  392. package/dist/taxId/index.js +4 -0
  393. package/dist/taxId/register-taxid.js +156 -0
  394. package/dist/video/Video.js +274 -0
  395. package/dist/video/Video.stories.js +45 -0
  396. package/dist/video/img/play-btn.svg +1 -0
  397. package/dist/video/index.js +2 -0
  398. package/package.json +128 -133
  399. package/public/favicon.ico +0 -0
  400. package/public/index.html +43 -0
  401. package/public/logo192.png +0 -0
  402. package/public/logo512.png +0 -0
  403. package/public/manifest.json +25 -0
  404. package/public/robots.txt +3 -0
  405. package/react-scripts +0 -0
  406. package/dist/07233f511246c9825a0d58e5ab2641f3.svg +0 -47
  407. package/dist/08418fc6c324f51f7e56.svg +0 -1
  408. package/dist/14aa35d4e84aebef77cf00b421fc393a.gif +0 -0
  409. package/dist/179ef2df02cb0b68c9fd.woff2 +0 -0
  410. package/dist/21e493d43617de76dbc7.woff2 +0 -0
  411. package/dist/2640959b1f9381cde047.eot +0 -0
  412. package/dist/2ba2db4ff86a2663686a100e75b50ba9.png +0 -0
  413. package/dist/311956ded96d3fd2813d.woff2 +0 -0
  414. package/dist/39f5961b2d3eb4aa5bf5.woff +0 -0
  415. package/dist/3caa0d4f9b7d58668066.woff2 +0 -0
  416. package/dist/4a510354f2f82b59fced805a8e3fe2bf.svg +0 -1
  417. package/dist/4c3c428d0ce82f840710.woff +0 -0
  418. package/dist/4e528d6445ca1974c313.woff +0 -0
  419. package/dist/55053cc0a8e6482eca64.ttf +0 -0
  420. package/dist/643c37f102b41f7f90c3.woff2 +0 -0
  421. package/dist/76dd0ed9c3f137513fd4.svg +0 -1
  422. package/dist/81f3ef07b7952e249da1.woff +0 -0
  423. package/dist/98b7d3182f652f021bc3.ttf +0 -0
  424. package/dist/9bea22b57dc165ed4382.ttf +0 -0
  425. package/dist/9ec738fbb66068dc1ca7.woff +0 -0
  426. package/dist/a1d7666a48f976227722.ttf +0 -0
  427. package/dist/a750292d6a0b5a760679.woff +0 -0
  428. package/dist/b85a961d44cc55c58050cbf7c53dd505.png +0 -0
  429. package/dist/bcb6531cf820152b7538.ttf +0 -0
  430. package/dist/c6a4bc1bd034d6303053.woff +0 -0
  431. package/dist/cbfc24090ef8bacab132.woff2 +0 -0
  432. package/dist/d2b1865643b98c0e8b54.ttf +0 -0
  433. package/dist/d97d7385fe8771611848.ttf +0 -0
  434. package/dist/index.js.LICENSE.txt +0 -1
@@ -0,0 +1,110 @@
1
+ import styled from 'styled-components/macro';
2
+ import { Link } from '@reach/router';
3
+ import theme from 'styles/theme';
4
+ export const BackButtonIcon = styled.i.attrs({
5
+ className: 'ion ion-ios-arrow-back'
6
+ })`
7
+ font-size: 16px;
8
+ position: absolute;
9
+ left: 0;
10
+ color: ${props => theme.cBlack};
11
+ transform: translateX(0);
12
+ transition: 0.3s color, 0.3s transform;
13
+ `;
14
+ export const ForwardButtonIcon = styled.i.attrs({
15
+ className: 'ion ion-ios-arrow-forward'
16
+ })`
17
+ font-size: 16px;
18
+ position: absolute;
19
+ right: 0;
20
+ color: ${props => theme.cBlack};
21
+ transform: translateX(0);
22
+ transition: 0.3s color, 0.3s transform;
23
+ `;
24
+ export const StyledBackButton = styled(Link)`
25
+ display: block;
26
+ font-size: 11px;
27
+ line-height: 16px;
28
+ letter-spacing: 2px;
29
+ color: ${props => theme.cBlack};
30
+ position: relative;
31
+ padding-left: 16px;
32
+ transition: 0.3s color;
33
+
34
+ &:hover {
35
+ color: ${props => theme.cPrimaryDark};
36
+
37
+ ${BackButtonIcon} {
38
+ transform: translateX(-4px);
39
+ color: ${props => theme.cPrimaryDark};
40
+ }
41
+ }
42
+ `;
43
+ export const StyledBackButtonExternal = styled.a`
44
+ display: block;
45
+ font-size: 11px;
46
+ line-height: 16px;
47
+ letter-spacing: 2px;
48
+ color: ${props => theme.cBlack};
49
+ position: relative;
50
+ padding-left: 16px;
51
+ transition: 0.3s color;
52
+
53
+ &:hover {
54
+ color: ${props => theme.cPrimaryDark};
55
+
56
+ ${BackButtonIcon} {
57
+ transform: translateX(-4px);
58
+ color: ${props => theme.cPrimaryDark};
59
+ }
60
+ }
61
+ `;
62
+ export const StyledWindowBackButton = styled.span`
63
+ display: block;
64
+ font-size: 11px;
65
+ line-height: 16px;
66
+ cursor: pointer;
67
+ letter-spacing: 2px;
68
+ color: ${props => theme.cBlack};
69
+ position: relative;
70
+ padding-left: 16px;
71
+ transition: 0.3s color;
72
+
73
+ &:hover {
74
+ color: ${props => theme.cPrimaryDark};
75
+
76
+ ${BackButtonIcon} {
77
+ transform: translateX(-4px);
78
+ color: ${props => theme.cPrimaryDark};
79
+ }
80
+ }
81
+ `;
82
+ export const StyledBackButtonClick = styled.div`
83
+ display: block;
84
+ font-size: 11px;
85
+ line-height: 16px;
86
+ letter-spacing: 2px;
87
+ color: ${props => theme.cBlack};
88
+ position: relative;
89
+ padding-left: 16px;
90
+ transition: 0.3s color;
91
+ cursor: pointer;
92
+
93
+ ${props => props.forward && `
94
+ padding-right: 16px;
95
+ `}
96
+
97
+ &:hover {
98
+ color: ${props => theme.cPrimaryDark};
99
+
100
+ ${BackButtonIcon} {
101
+ transform: translateX(-4px);
102
+ color: ${props => theme.cPrimaryDark};
103
+ }
104
+
105
+ ${ForwardButtonIcon} {
106
+ transform: translateX(4px);
107
+ color: ${props => theme.cPrimaryDark};
108
+ }
109
+ }
110
+ `;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { Container, Wrap, Img, Content } from './Background.styles';
4
+ export const Background = props => {
5
+ const {
6
+ children,
7
+ src,
8
+ mobileRatio,
9
+ investmentOpportunities,
10
+ withPadding,
11
+ contain
12
+ } = props;
13
+ return /*#__PURE__*/React.createElement(Container, {
14
+ mobileRatio: mobileRatio,
15
+ investmentOpportunities: investmentOpportunities
16
+ }, /*#__PURE__*/React.createElement(Wrap, null, /*#__PURE__*/React.createElement(Img, {
17
+ src: src,
18
+ alt: "background",
19
+ contain: contain,
20
+ withPadding: withPadding,
21
+ investmentOpportunities: investmentOpportunities
22
+ })), /*#__PURE__*/React.createElement(Content, null, children));
23
+ };
24
+ Background.propTypes = {
25
+ src: PropTypes.string.isRequired,
26
+ mobileRatio: PropTypes.string,
27
+ // example: '16:9'
28
+ children: PropTypes.node
29
+ };
30
+ Background.defaultProps = {
31
+ mobileRatio: '',
32
+ children: /*#__PURE__*/React.createElement("div", null)
33
+ };
34
+ export default Background;
@@ -0,0 +1,50 @@
1
+ import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
2
+ import React from 'react';
3
+ import { Background } from './Background';
4
+ import { TwoSvg } from 'components/SvgIcons';
5
+ export default {
6
+ title: 'Components Library/Background',
7
+ component: Background,
8
+ argTypes: {
9
+ src: {
10
+ type: 'string',
11
+ required: true,
12
+ defaultValue: 'https://www.cookingclassy.com/wp-content/uploads/2014/06/chocolate-chip-cookie-16.jpg'
13
+ },
14
+ mobileRatio: {
15
+ type: 'string',
16
+ defaultValue: ''
17
+ },
18
+ children: {
19
+ type: 'node',
20
+ defaultValue: /*#__PURE__*/React.createElement("div", null)
21
+ },
22
+ investmentOpportunities: {
23
+ type: 'node'
24
+ }
25
+ },
26
+ parameters: {
27
+ viewport: {
28
+ viewports: INITIAL_VIEWPORTS,
29
+ defaultViewport: ''
30
+ }
31
+ }
32
+ };
33
+ const Template = args => /*#__PURE__*/React.createElement(Background, args, /*#__PURE__*/React.createElement(TwoSvg, null));
34
+ export const BackgroundDefault = Template.bind({});
35
+ BackgroundDefault.args = {};
36
+ BackgroundDefault.parameters = {
37
+ viewport: {
38
+ defaultViewport: 'reset viewport'
39
+ }
40
+ };
41
+ export const BackgroundMobile = Template.bind({});
42
+ BackgroundMobile.args = {
43
+ mobileRatio: '16:9',
44
+ children: /*#__PURE__*/React.createElement("div", null)
45
+ };
46
+ BackgroundMobile.parameters = {
47
+ viewport: {
48
+ defaultViewport: 'iphonex'
49
+ }
50
+ };
@@ -0,0 +1,113 @@
1
+ import styled from 'styled-components/macro';
2
+ import rwd from 'styles/rwd';
3
+ export const Container = styled.div`
4
+ position: relative;
5
+ width: 100%;
6
+ height: 100%;
7
+ font-size: 0;
8
+
9
+ ${props => {
10
+ if (!props.mobileRatio) return '';
11
+ const ratio = props.mobileRatio.split(':');
12
+ const percent = 100 * ratio[1] / ratio[0];
13
+ return `
14
+ &:after {
15
+ z-index: 0;
16
+ content: '';
17
+ position: relative;
18
+ display: inline-block;
19
+ vertical-align: top;
20
+ width: 100%;
21
+ height: 100%;
22
+ padding-top: ${percent}%;
23
+ margin-left: -100%;
24
+ }
25
+ `;
26
+ }}
27
+
28
+ &:after {
29
+ ${rwd.Medium`
30
+ display: none;
31
+ `}
32
+ }
33
+
34
+ ${props => props.investmentOpportunities && `
35
+ padding-top: 33% !important;
36
+ `}
37
+ `;
38
+ export const Wrap = styled.div`
39
+ z-index: 1;
40
+ position: absolute;
41
+ top: 0;
42
+ left: 0;
43
+ width: 100%;
44
+ height: 100%;
45
+ overflow: hidden;
46
+
47
+ & > div {
48
+ height: 100%;
49
+ }
50
+ `;
51
+
52
+ // // Concerning MERGE:
53
+ // // differences from Img SUF below, left out of merge. Visually gave extra padding to background
54
+ // const Img
55
+ // export const Img = styled.img`
56
+ // top: 50%;
57
+ // left: 50%;
58
+ // height: auto;
59
+ // padding: 20px;
60
+ // transform: translate(-50%, -50%);
61
+ // // same as others:
62
+ // position: absolute;
63
+ // width: 100%;
64
+ // object-fit: cover;
65
+ // object-position: center center;
66
+
67
+ export const Img = styled.img`
68
+ position: absolute;
69
+ width: 100%;
70
+ object-fit: cover;
71
+ object-position: center center;
72
+ top: 0;
73
+ left: 0;
74
+ height: 100%;
75
+
76
+ ${props => props.investmentOpportunities && `
77
+ height: 100%;
78
+ `}
79
+ ${props => props.withPadding && `
80
+ padding: 20px;
81
+ `}
82
+ ${props => props.contain && `
83
+ object-fit:contain;
84
+ `}
85
+ `;
86
+ export const Video = styled.video`
87
+ object-fit: cover;
88
+ width: 100%;
89
+ height: 100%;
90
+ `;
91
+ export const Image = styled.img`
92
+ /* Make video to at least 100% wide and tall */
93
+ min-width: 100%;
94
+ min-height: 100%;
95
+
96
+ /* Setting width & height to auto prevents the browser from stretching or squishing the video */
97
+ width: auto;
98
+ height: auto;
99
+
100
+ /* Center the video */
101
+ position: absolute;
102
+ top: 50%;
103
+ left: 50%;
104
+ transform: translate(-50%, -50%);
105
+ `;
106
+ export const Content = styled.div`
107
+ z-index: 2;
108
+ position: relative;
109
+ display: inline-block;
110
+ vertical-align: top;
111
+ width: 100%;
112
+ font-size: 10px;
113
+ `;
@@ -0,0 +1,258 @@
1
+ import React, { PureComponent, Fragment } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import * as d3 from 'd3';
4
+ import { Tooltip } from 'react-tippy';
5
+
6
+ /*
7
+ inspired on https://blog.risingstack.com/d3-js-tutorial-bar-charts-with-javascript/
8
+ */
9
+
10
+ import { Chart, TooltipWrapper, ChartTitle } from './BarChart.styles';
11
+ const gradients = {
12
+ default: {
13
+ start: '#0050ca',
14
+ end: '#0050ca'
15
+ },
16
+ red: {
17
+ start: '#f24f45',
18
+ end: '#ee220d'
19
+ },
20
+ blue: {
21
+ start: '#6a97e0',
22
+ end: '#0050ca'
23
+ }
24
+ };
25
+ export class BarChart extends PureComponent {
26
+ transitionDuration = 800;
27
+ transitionDatumDelay = 100;
28
+ state = {
29
+ tooltipOpen: false,
30
+ dataIndex: 0
31
+ };
32
+ componentDidMount() {
33
+ this.createChart();
34
+ window.addEventListener('resize', this.onResize);
35
+ window.addEventListener('scroll', this.onScroll);
36
+ this.onScroll();
37
+ }
38
+ componentWillUnmount() {
39
+ clearTimeout(this.resizeTimeout);
40
+ window.removeEventListener('resize', this.onResize);
41
+ window.removeEventListener('scroll', this.onScroll);
42
+ }
43
+ onResize = () => {
44
+ clearTimeout(this.resizeTimeout);
45
+ this.resizeTimeout = setTimeout(this.onResizeTimeout, 200);
46
+ };
47
+ onResizeTimeout = () => {
48
+ this.updateChart(true);
49
+ };
50
+ onScroll = e => {
51
+ if (this.drawn) return;
52
+ if (this.chartEl.getBoundingClientRect().top < window.innerHeight) {
53
+ this.initialDrawChart();
54
+ }
55
+ };
56
+ initialDrawChart = () => {
57
+ this.updateChart();
58
+ this.drawn = true;
59
+ };
60
+ createChart = () => {
61
+ if (!this.chartEl) return;
62
+ const {
63
+ id,
64
+ data,
65
+ colorTheme
66
+ } = this.props;
67
+ const initData = data.map(datum => ({
68
+ ...datum,
69
+ value: 0
70
+ }));
71
+ const {
72
+ dataIndex
73
+ } = this.state;
74
+ const tooltip = !!data[dataIndex].tooltip;
75
+ const wrapperWidth = this.chartEl.offsetWidth;
76
+ const wrapperHeight = 320;
77
+ const margin = {
78
+ top: 20,
79
+ left: 0,
80
+ right: 40,
81
+ bottom: 30
82
+ };
83
+ const width = wrapperWidth - (margin.left + margin.right);
84
+ const height = wrapperHeight - (margin.top + margin.bottom);
85
+ const thickness = 6;
86
+ const hThickness = thickness / 2;
87
+ this.hThickness = hThickness;
88
+
89
+ // #region x scale
90
+ const xScale = this.getXScale(data, width);
91
+ // #endregion x scale
92
+
93
+ // #region y scale
94
+ const yScale = this.getYScale(data, height);
95
+ // #endregion y scale
96
+
97
+ this.svg = d3.select(this.chartEl).append('svg').attr('width', wrapperWidth).attr('height', wrapperHeight);
98
+ this.chart = this.svg.append('g').attr('transform', `translate(${margin.left}, ${margin.top})`);
99
+ const defs = this.svg.append('defs');
100
+
101
+ // #region gradient
102
+ const gradient = defs.append('linearGradient').attr('id', `${id}-barChart-gradient`).attr('x1', '50%').attr('x2', '50%').attr('y1', '100%').attr('y2', '0%');
103
+ gradient.append('stop').attr('class', 'start').attr('offset', '0%').attr('stop-color', gradients[colorTheme].start).attr('stop-opacity', 1);
104
+ gradient.append('stop').attr('class', 'end').attr('offset', '100%').attr('stop-color', gradients[colorTheme].end).attr('stop-opacity', 1);
105
+ // #endregion gradient
106
+
107
+ // #region grid x axis
108
+ this.xGrid = this.chart.append('g').attr('class', 'gridX').attr('transform', `translate(0, ${height})`).call(d3.axisBottom().scale(xScale).tickSize(-height, 0, 0).tickFormat(''));
109
+ // #endregion grid x axis
110
+
111
+ // #region grid y axis
112
+ this.yGrid = this.chart.append('g').attr('class', 'gridY').attr('transform', `translate(${width}, 0)`).call(d3.axisRight().scale(yScale).tickSize(-width, 0, 0).ticks(4).tickFormat(''));
113
+ // #endregion grid y axis
114
+
115
+ const tickValues = xScale.domain().length > 20 ? xScale.domain().filter((datum, index) => !(index % 2)) : xScale.domain();
116
+
117
+ // #region x axis
118
+ this.xAxis = this.chart.append('g').attr('class', 'axisX').attr('transform', `translate(0, ${height})`).call(d3.axisBottom().scale(xScale).tickValues(tickValues));
119
+ // #endregion x axis
120
+
121
+ // #region y axis
122
+ this.yAxis = this.chart.append('g').attr('class', 'axisY').attr('transform', `translate(${width}, 0)`).call(d3.axisRight().scale(yScale).ticks(4));
123
+ // #endregion y axis
124
+
125
+ // #region bars
126
+ const chartContext = this;
127
+ this.chart.selectAll().data(initData).enter().append('path').attr('class', 'bar').style('fill', `url(#${id}-barChart-gradient)`).attr('transform', `translate(${-hThickness}, 0)`).each(function bindContext(d, i) {
128
+ d3.select(this).node().chartContext = chartContext;
129
+ }).on('mouseenter', tooltip ? this.onMouseEnter : () => {}).on('mouseleave', tooltip ? this.onMouseLeave : () => {}).attr('d', this.getBarDAttrFn(xScale, yScale, height, hThickness, thickness));
130
+ // #endregion bars
131
+ };
132
+
133
+ setTooltip = (opened, dataIndex) => {
134
+ const newState = {
135
+ tooltipOpen: opened
136
+ };
137
+ if (dataIndex !== undefined) newState.dataIndex = dataIndex;
138
+ this.setState(newState);
139
+ };
140
+ onMouseEnter = function onMouseEnter(d, i) {
141
+ const chartRect = this.chartContext.chartEl.getBoundingClientRect();
142
+ const barRect = this.getBoundingClientRect();
143
+ const y = barRect.y - chartRect.y;
144
+ const x = barRect.x - chartRect.x + this.chartContext.hThickness;
145
+ this.chartContext.tooltipEl.style.left = `${x}px`;
146
+ this.chartContext.tooltipEl.style.top = `${y}px`;
147
+ this.chartContext.setTooltip(true, i);
148
+ };
149
+ onMouseLeave = function onMouseLeave(d, i) {
150
+ this.chartContext.setTooltip(false);
151
+ };
152
+ updateChart = resizeUpdate => {
153
+ if (!this.chartEl) return;
154
+ const {
155
+ data
156
+ } = this.props;
157
+ const durration = this.transitionDuration;
158
+ const delay = this.transitionDatumDelay;
159
+ const wrapperWidth = this.chartEl.offsetWidth;
160
+ const wrapperHeight = 320;
161
+ const margin = {
162
+ top: 20,
163
+ left: 0,
164
+ right: 40,
165
+ bottom: 30
166
+ };
167
+ const width = wrapperWidth - (margin.left + margin.right);
168
+ const height = wrapperHeight - (margin.top + margin.bottom);
169
+ const thickness = 6;
170
+ const hThickness = thickness / 2;
171
+
172
+ // #region x scale
173
+ const xScale = this.getXScale(data, width);
174
+ // #endregion x scale
175
+
176
+ // #region y scale
177
+ const yScale = this.getYScale(data, height);
178
+ // #endregion y scale
179
+
180
+ // #region root svg
181
+ this.svg.transition().duration(durration).attr('width', wrapperWidth).attr('height', wrapperHeight);
182
+ // #endregion root svg
183
+
184
+ // #region grid x axis
185
+ this.xGrid.transition().duration(durration).attr('transform', `translate(0, ${height})`).call(d3.axisBottom().scale(xScale).tickSize(-height, 0, 0).tickFormat(''));
186
+ // #endregion grid x axis
187
+
188
+ // #region grid y axis
189
+ this.yGrid.transition().duration(durration).attr('transform', `translate(${width}, 0)`).call(d3.axisRight().scale(yScale).tickSize(-width, 0, 0).ticks(4).tickFormat(''));
190
+ // #endregion grid y axis
191
+
192
+ const tickValues = xScale.domain().length > 20 ? xScale.domain().filter((datum, index) => !(index % 2)) : xScale.domain();
193
+
194
+ // #region x axis
195
+ this.xAxis.transition().duration(durration).attr('transform', `translate(0, ${height})`).call(d3.axisBottom().scale(xScale).tickValues(tickValues));
196
+ // #endregion x axis
197
+
198
+ // #region y axis
199
+ this.yAxis.transition().duration(durration).attr('transform', `translate(${width}, 0)`).call(d3.axisRight().scale(yScale).ticks(4));
200
+ // #endregion y axis
201
+
202
+ // #region bars
203
+ this.chart.selectAll('.bar').data(data).transition().delay((_, index) => resizeUpdate ? 0 : index * delay).duration(durration).attr('d', this.getBarDAttrFn(xScale, yScale, height, hThickness, thickness));
204
+ // #endregion bars
205
+ };
206
+
207
+ getBarDAttrFn = (xScale, yScale, height, hThickness, thickness) => datum => `
208
+ M${xScale(datum.name)},${yScale(datum.value) + hThickness}
209
+ a${hThickness},${hThickness} 0 0 1 ${hThickness},${-hThickness}
210
+ a${hThickness},${hThickness} 0 0 1 ${hThickness},${hThickness}
211
+ v${height - yScale(datum.value) - hThickness}
212
+ h${-thickness}Z
213
+ `;
214
+ getXScale = (data, width) => d3.scaleBand().range([0, width]).domain(data.map(datum => datum.name)).paddingInner(1).paddingOuter(0.5);
215
+ getYScale = (data, height) => d3.scaleLinear().range([height, 0]).domain([0, d3.max(data, datum => Math.ceil(datum.value / 10) * 10)]);
216
+ render() {
217
+ const {
218
+ tooltipOpen,
219
+ dataIndex
220
+ } = this.state;
221
+ const {
222
+ data,
223
+ title
224
+ } = this.props;
225
+ return /*#__PURE__*/React.createElement(Fragment, null, title && /*#__PURE__*/React.createElement(ChartTitle, null, title), /*#__PURE__*/React.createElement(Chart, {
226
+ ref: el => {
227
+ this.chartEl = el;
228
+ }
229
+ }, data[dataIndex].tooltip && /*#__PURE__*/React.createElement(TooltipWrapper, {
230
+ ref: el => {
231
+ this.tooltipEl = el;
232
+ }
233
+ }, /*#__PURE__*/React.createElement(Tooltip, {
234
+ open: tooltipOpen,
235
+ position: "top",
236
+ animation: "fade",
237
+ html: data[dataIndex].tooltip,
238
+ theme: "light",
239
+ arrow: true,
240
+ duration: 200
241
+ }))));
242
+ }
243
+ }
244
+ BarChart.propTypes = {
245
+ id: PropTypes.string.isRequired,
246
+ title: PropTypes.string,
247
+ data: PropTypes.arrayOf(PropTypes.shape({
248
+ value: PropTypes.number.isRequired,
249
+ name: PropTypes.string,
250
+ tooltip: PropTypes.oneOfType([PropTypes.string, PropTypes.node])
251
+ })).isRequired,
252
+ colorTheme: PropTypes.oneOf(['default', 'red', 'blue'])
253
+ };
254
+ BarChart.defaultProps = {
255
+ title: '',
256
+ colorTheme: 'default'
257
+ };
258
+ export default BarChart;
@@ -0,0 +1,46 @@
1
+ // import React from 'react'
2
+ // import { BarChart } from './BarChart'
3
+ // import { ComponentWrapper } from '../ComponentWrapper/ComponentWrapper.styles'
4
+
5
+ // export default {
6
+ // title: 'Components Library/BarChart',
7
+ // component: BarChart,
8
+ // argTypes: {
9
+ // data: {
10
+ // type: 'array of shape',
11
+ // defaultValue: [{ value: 0 }, { name: '' }, { tooltip: '' }],
12
+ // required: true,
13
+ // },
14
+ // value: { type: 'number', required: true },
15
+ // name: { type: 'string' },
16
+ // tooltip: { type: 'string or node' },
17
+ // id: { type: 'string', required: true },
18
+ // title: { type: 'string', defaultValue: '' },
19
+ // colorTheme: { type: 'string', defaultValue: 'default' },
20
+ // },
21
+ // }
22
+
23
+ // const Template = args => (
24
+ // <ComponentWrapper>
25
+ // <BarChart {...args} />
26
+ // </ComponentWrapper>
27
+ // )
28
+
29
+ // export const BarChartDefault = Template.bind({})
30
+ // BarChartDefault.args = {}
31
+
32
+ // export const BarChartFull = Template.bind({})
33
+ // BarChartFull.args = {
34
+ // data: [
35
+ // {
36
+ // value: 1560,
37
+ // name: 'Name',
38
+ // colorThem: 'red',
39
+ // },
40
+ // ],
41
+ // id: 'Identity',
42
+ // title: 'A Title',
43
+ // }
44
+
45
+ // doublecheck:
46
+ // d3 causing SB to crash. cannot resolve
@@ -0,0 +1,93 @@
1
+ import styled from 'styled-components/macro';
2
+ import theme from 'styles/theme';
3
+ export const Chart = styled.div`
4
+ position: relative;
5
+ display: block;
6
+ width: 100%;
7
+ height: auto;
8
+ overflow: hidden;
9
+
10
+ .axisX,
11
+ .axisY {
12
+ & > path {
13
+ stroke: #e1e1e1;
14
+ }
15
+
16
+ .tick {
17
+ text {
18
+ font-family: 'Open Sans';
19
+ font-weight: 600;
20
+ font-size: 14px;
21
+ line-height: 20px;
22
+ /* fill: #9b9b9b; */
23
+ color: ${props => theme.cGrey2};
24
+ }
25
+
26
+ line {
27
+ stroke: none;
28
+ }
29
+ }
30
+ }
31
+
32
+ .axisY {
33
+ & > path {
34
+ stroke: none;
35
+ }
36
+ }
37
+
38
+ .gridX,
39
+ .gridY {
40
+ & > path {
41
+ stroke: none;
42
+ }
43
+ }
44
+
45
+ .gridX {
46
+ .tick line {
47
+ stroke: none;
48
+ }
49
+ }
50
+
51
+ .gridY {
52
+ .tick line {
53
+ stroke: #dfe5f1;
54
+ }
55
+ }
56
+ `;
57
+ export default Chart;
58
+ export const TooltipWrapper = styled.div`
59
+ position: absolute;
60
+ top: 0;
61
+ left: 0;
62
+ pointer-events: none;
63
+ `;
64
+ export const BarChartTooltip = styled.div`
65
+ font-size: 10px;
66
+ min-width: 40px;
67
+
68
+ & > h3 {
69
+ font-weight: 400;
70
+ font-family: 'Open Sans';
71
+ font-size: 16px;
72
+ margin: 0;
73
+ padding: 0;
74
+ }
75
+
76
+ & > p {
77
+ /* color: ${props => theme.cProgressDone}; */
78
+ color: #79ca65;
79
+ font-family: 'Open Sans';
80
+ font-size: 11px;
81
+ text-transform: uppercase;
82
+ }
83
+ `;
84
+ export const ChartTitle = styled.div`
85
+ font-family: 'Open Sans';
86
+ font-size: 12px;
87
+ line-height: 20px;
88
+ text-align: center;
89
+ letter-spacing: 2px;
90
+ text-transform: uppercase;
91
+ padding: 0;
92
+ margin: 0;
93
+ `;