@stokr/components-library 2.3.65-beta.1 → 2.3.65-beta.11

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 (222) hide show
  1. package/dist/components/2FA/main-flow.js +28 -7
  2. package/dist/components/AdminDashboard/Table/ReactTable.js +123 -7
  3. package/dist/components/Chips/Chip.js +1 -2
  4. package/dist/components/Chips/Chip.styles.js +3 -2
  5. package/dist/components/Input/Input.js +33 -33
  6. package/dist/components/Input/MultiSelect.js +319 -0
  7. package/dist/components/Input/SearchInput.js +78 -0
  8. package/dist/components/Input/SearchInput.styles.js +25 -0
  9. package/dist/components/Input/Select.js +51 -28
  10. package/dist/components/Modal/SideModal.js +82 -0
  11. package/dist/components/Modal/SideModal.styles.js +21 -0
  12. package/dist/components/Payment/PaymentDetailsCard.js +189 -0
  13. package/dist/components/Payment/PaymentDisplay.js +2 -12
  14. package/dist/components/ProfileBox/ProfileBox.js +2 -1
  15. package/dist/components/Snackbar/Snackbar.js +193 -0
  16. package/dist/components/Snackbar/Snackbar.styles.js +97 -0
  17. package/dist/components/Snackbar/SnackbarProvider.js +81 -0
  18. package/dist/components/Snackbar/index.js +32 -0
  19. package/dist/components/Snackbar/useSnackbar.js +43 -0
  20. package/dist/components/StatusTag/StatusTag.js +175 -0
  21. package/dist/components/StatusTag/StatusTag.styles.js +37 -0
  22. package/dist/components/StepsProgress/StepIndicator.js +59 -0
  23. package/dist/components/StepsProgress/StepIndicator.styles.js +30 -0
  24. package/dist/components/TextLink/TextLink.styles.js +1 -1
  25. package/dist/components/Timeline/TimelineStep.js +2 -2
  26. package/dist/constants/globalVariables.js +41 -2
  27. package/dist/context/Checkbox/CheckboxContext.js +0 -1
  28. package/dist/index.js +66 -0
  29. package/dist/static/images/bmn2-logo.svg +9 -0
  30. package/dist/static/images/document-icon.svg +3 -0
  31. package/dist/static/images/plus-icon.svg +4 -0
  32. package/dist/static/images/search-icon.svg +3 -0
  33. package/dist/static/images/sent-icon.svg +10 -0
  34. package/dist/static/images/transfer-icon.svg +10 -0
  35. package/dist/utils/formatCurrencyValue.js +43 -3
  36. package/package.json +3 -2
  37. package/dist/components/2FA/EnterCode.stories.js +0 -35
  38. package/dist/components/2FA/disable-2fa-flow.stories.js +0 -31
  39. package/dist/components/2FA/enable-2fa-flow.stories.js +0 -31
  40. package/dist/components/2FA/login-with-otp-flow.stories.js +0 -31
  41. package/dist/components/2FA/main-flow.stories.js +0 -33
  42. package/dist/components/AccountBalance/AccountBalance.stories.js +0 -83
  43. package/dist/components/AdminDashboard/Table/ReactTable.stories.js +0 -406
  44. package/dist/components/AgreementItem/AgreementItem.stories.js +0 -105
  45. package/dist/components/AnalyticGraphs/Analytic.js +0 -541
  46. package/dist/components/AnalyticGraphs/Analytic.styles.js +0 -25
  47. package/dist/components/BackButton/BackButton.stories.js +0 -32
  48. package/dist/components/Background/Background.stories.js +0 -75
  49. package/dist/components/BarChart/BarChart.js +0 -263
  50. package/dist/components/BarChart/BarChart.stories.js +0 -66
  51. package/dist/components/BarChart/BarChart.styles.js +0 -26
  52. package/dist/components/BarChartLegend/BarChartLegend.js +0 -79
  53. package/dist/components/BarChartLegend/BarChartLegend.styles.js +0 -21
  54. package/dist/components/BasicTable/BasicTable.stories.js +0 -59
  55. package/dist/components/BlogPost/BlogPost.stories.js +0 -160
  56. package/dist/components/Button/Button.stories.js +0 -146
  57. package/dist/components/Button/GlareButton.stories.js +0 -132
  58. package/dist/components/CapitalRaisedSummary/CapitalRaisedSummery.stories.js +0 -42
  59. package/dist/components/ChartBox/ChartBox.js +0 -41
  60. package/dist/components/ChartBox/ChartBox.stories.js +0 -17
  61. package/dist/components/ChartBox/ChartBox.styles.js +0 -27
  62. package/dist/components/ChartBox/ChartBoxDistribution.js +0 -27
  63. package/dist/components/ChartBox/ChartBoxDistribution.stories.js +0 -18
  64. package/dist/components/ChartLegend/ChartLegend.stories.js +0 -90
  65. package/dist/components/Checkbox/Checkbox.stories.js +0 -88
  66. package/dist/components/Checklist/ChecklistCard.stories.js +0 -102
  67. package/dist/components/Checklist/UserChecklist.js +0 -184
  68. package/dist/components/Checklist/UserChecklist.stories.js +0 -317
  69. package/dist/components/Chips/Chip.stories.js +0 -36
  70. package/dist/components/Chips/ChipsWrapper.stories.js +0 -47
  71. package/dist/components/ComponentScroll/ComponentScroll.stories.js +0 -111
  72. package/dist/components/CryptoAddress/CryptoAddress.stories.js +0 -205
  73. package/dist/components/CryptoAddressDetails/CryptoAddressDetails.stories.js +0 -70
  74. package/dist/components/DonutChart/DonutChart.stories.js +0 -54
  75. package/dist/components/FAQ/FAQ.stories.js +0 -76
  76. package/dist/components/Footer/Footer.stories.js +0 -49
  77. package/dist/components/Footer/FooterLayout.stories.js +0 -26
  78. package/dist/components/Footer/FooterMenu.stories.js +0 -113
  79. package/dist/components/Footer/mangopay.png +0 -0
  80. package/dist/components/Footer/mangopay.svg +0 -20
  81. package/dist/components/ForgotPasswordModal/ForgotPasswordModal.stories.js +0 -69
  82. package/dist/components/Form/Form.stories.js +0 -32
  83. package/dist/components/FullscreenCard/FullscreenCard.styles.js +0 -27
  84. package/dist/components/Header/Header.stories.js +0 -192
  85. package/dist/components/InfoIcon/InfoIcon.stories.js +0 -299
  86. package/dist/components/InfoPanel/InfoPanel.js +0 -124
  87. package/dist/components/Input/DatePickerInput.stories.js +0 -87
  88. package/dist/components/Input/Input.stories.js +0 -142
  89. package/dist/components/Input/InputPassword.stories.js +0 -80
  90. package/dist/components/Input/InputWithButton.stories.js +0 -75
  91. package/dist/components/Input/OtpInput.stories.js +0 -57
  92. package/dist/components/Input/RangeInput.stories.js +0 -58
  93. package/dist/components/Input/Select.stories.js +0 -139
  94. package/dist/components/InvestCalculator/InvestCalculator.stories.js +0 -135
  95. package/dist/components/InvestmentStat/InvestmentStat.stories.js +0 -52
  96. package/dist/components/KYCFlow/BasicInfo.js +0 -448
  97. package/dist/components/KYCFlow/Confirmation.js +0 -46
  98. package/dist/components/KYCFlow/DocumentFileUpload.js +0 -263
  99. package/dist/components/KYCFlow/DocumentScan.js +0 -75
  100. package/dist/components/KYCFlow/DocumentScanUpload.js +0 -251
  101. package/dist/components/KYCFlow/DocumentSelect.js +0 -118
  102. package/dist/components/KYCFlow/DocumentSuccess.js +0 -63
  103. package/dist/components/KYCFlow/DocumentUpload.js +0 -53
  104. package/dist/components/KYCFlow/DocumentVerificationType.js +0 -131
  105. package/dist/components/KYCFlow/FaceScan.js +0 -54
  106. package/dist/components/KYCFlow/FaceScanRecognition.js +0 -61
  107. package/dist/components/KYCFlow/FaceScanSuccess.js +0 -56
  108. package/dist/components/KYCFlow/Terms.js +0 -119
  109. package/dist/components/KYCFlow/_styles.js +0 -111
  110. package/dist/components/KYCFlow/index.js +0 -97
  111. package/dist/components/KYCSelectBox/KYCSelectBox.styles.js +0 -29
  112. package/dist/components/LatestUpdate/LatestUpdate.stories.js +0 -58
  113. package/dist/components/Layout/Layout.stories.js +0 -60
  114. package/dist/components/LearnMoreCarousel/LearnMoreCarousel.stories.js +0 -66
  115. package/dist/components/LearnMorePage/LearnMore.stories.js +0 -48
  116. package/dist/components/LearnMorePage/LearnMoreItem.stories.js +0 -62
  117. package/dist/components/LearnMoreSection/LearnMore.stories.js +0 -30
  118. package/dist/components/LearnMoreSection/LearnMoreItem.stories.js +0 -59
  119. package/dist/components/LoginModal/LoginModal.stories.js +0 -74
  120. package/dist/components/MatomoConnect/Matomo.js +0 -228
  121. package/dist/components/MatomoConnect/Matomo_fuckup.js +0 -387
  122. package/dist/components/Modal/Modal.stories.js +0 -75
  123. package/dist/components/Modal/NewVentureModal/NewVentureModal.stories.js +0 -150
  124. package/dist/components/Modal/PaymentModal.stories.js +0 -57
  125. package/dist/components/MultiProgressBar/MultiProgressBar.stories.js +0 -67
  126. package/dist/components/Newsletter/Newsletter.stories.js +0 -16
  127. package/dist/components/NotificationContext/NotificationContext.js +0 -141
  128. package/dist/components/Number/Number.stories.js +0 -92
  129. package/dist/components/Pagination/Pagination.stories.js +0 -83
  130. package/dist/components/Pagination/PaginationControls.stories.js +0 -112
  131. package/dist/components/Payment/PaymentDisplay.stories.js +0 -302
  132. package/dist/components/Payment/TimerComponent.stories.js +0 -236
  133. package/dist/components/Process/Process.stories.js +0 -42
  134. package/dist/components/ProfileBadge/ProfileBadge.stories.js +0 -45
  135. package/dist/components/ProfileBox/ProfileBox.stories.js +0 -35
  136. package/dist/components/ProfileHeader/ProfileHeader.js +0 -252
  137. package/dist/components/ProfileHeader/ProfileHeader.styles.js +0 -65
  138. package/dist/components/ProfileStat/ProfileStat.stories.js +0 -66
  139. package/dist/components/ProofOfAddress/ProofOfAddress.styles.js +0 -53
  140. package/dist/components/QRCode/QRCode.stories.js +0 -104
  141. package/dist/components/Radio/Radio.stories.js +0 -73
  142. package/dist/components/RefreshButton/RefreshButton.stories.js +0 -38
  143. package/dist/components/RegisterAlgorand/AlgoAddressName.js +0 -138
  144. package/dist/components/RegisterAlgorand/AlgoAdressSelect.js +0 -443
  145. package/dist/components/RegisterAlgorand/AlgoConnectWallet.js +0 -47
  146. package/dist/components/RegisterAlgorand/AlgoSuccess.js +0 -38
  147. package/dist/components/RegisterAlgorand/Algorand.stories.js +0 -80
  148. package/dist/components/RegisterAlgorand/ChooseWallet.js +0 -97
  149. package/dist/components/RegisterAlgorand/SelectProject.js +0 -89
  150. package/dist/components/RegisterAlgorand/_styles.js +0 -28
  151. package/dist/components/RegisterAlgorand/flow.js +0 -409
  152. package/dist/components/RegisterAlgorand/flowWithMemo.js +0 -410
  153. package/dist/components/RegisterAlgorand/index.js +0 -48
  154. package/dist/components/RegisterConfirmModal/RegisterConfirmModal.stories.js +0 -41
  155. package/dist/components/RegisterEthereum/EthAddressLedger.js +0 -226
  156. package/dist/components/RegisterEthereum/EthAddressMetamask.js +0 -204
  157. package/dist/components/RegisterEthereum/EthAddressName.js +0 -135
  158. package/dist/components/RegisterEthereum/EthConnectLedger.js +0 -194
  159. package/dist/components/RegisterEthereum/EthConnectMetamask.js +0 -35
  160. package/dist/components/RegisterEthereum/EthFinish.js +0 -41
  161. package/dist/components/RegisterEthereum/EthIntro.js +0 -95
  162. package/dist/components/RegisterEthereum/_styles.js +0 -28
  163. package/dist/components/RegisterEthereum/index.js +0 -68
  164. package/dist/components/RegisterModal/RegisterModal.stories.js +0 -49
  165. package/dist/components/RequestDataBox/RequestDataBox.stories.js +0 -37
  166. package/dist/components/RiskQuestionnaire/RiskQuestionnaireContext.js +0 -185
  167. package/dist/components/RiskQuestionnaire/_styles.js +0 -15
  168. package/dist/components/SEO/SEO.stories.js +0 -60
  169. package/dist/components/SideLine/SideLine.stories.js +0 -28
  170. package/dist/components/SigningSubflow/SignSubAddressMetamask.js +0 -137
  171. package/dist/components/SigningSubflow/SignSubConnectLedger.js +0 -150
  172. package/dist/components/SigningSubflow/SignSubConnectMetamask.js +0 -137
  173. package/dist/components/SigningSubflow/SignSubIntro.js +0 -55
  174. package/dist/components/SigningSubflow/SignSubSendLedger.js +0 -150
  175. package/dist/components/SigningSubflow/SignSubSendMetamask.js +0 -62
  176. package/dist/components/SigningSubflow/SignSubTransactionLedger.js +0 -161
  177. package/dist/components/SigningSubflow/SignSubTransactionMetamask.js +0 -166
  178. package/dist/components/SigningSubflow/_styles.js +0 -34
  179. package/dist/components/SigningSubflow/index.js +0 -32
  180. package/dist/components/Slider/Slider.stories.js +0 -68
  181. package/dist/components/StepController/StepController.stories.js +0 -60
  182. package/dist/components/StepController/StepControllerProgress.stories.js +0 -49
  183. package/dist/components/StepsProgress/StepsProgress.stories.js +0 -49
  184. package/dist/components/Switch/Switch.stories.js +0 -81
  185. package/dist/components/Tabs/Tabs.stories.js +0 -36
  186. package/dist/components/TabsNav/TabNav.stories.js +0 -40
  187. package/dist/components/TabsNav/TabsNav.stories.js +0 -37
  188. package/dist/components/TeamOverview/TeamOverview.stories.js +0 -76
  189. package/dist/components/TermsModal/TermsModal.stories.js +0 -31
  190. package/dist/components/Text/Headline.stories.js +0 -48
  191. package/dist/components/Text/Text.stories.js +0 -70
  192. package/dist/components/Timeline/Timeline.stories.js +0 -393
  193. package/dist/components/ToDoList/ToDoList.stories.js +0 -133
  194. package/dist/components/ToDoList/ToDoListTask.stories.js +0 -70
  195. package/dist/components/TransactionDetails/TransactionDetails.stories.js +0 -55
  196. package/dist/components/TransactionDetails/TransactionDetailsTable.stories.js +0 -305
  197. package/dist/components/TransactionInfo/TransactionInfo.stories.js +0 -61
  198. package/dist/components/TwoFactorModal/TwoFactorModal.js +0 -100
  199. package/dist/components/VerifyEmailModal/VerifyEmailModal.stories.js +0 -59
  200. package/dist/components/headerHo/HeaderHo.stories.js +0 -35
  201. package/dist/components/icons/Arrow.stories.js +0 -42
  202. package/dist/components/icons/ArrowSimple.stories.js +0 -48
  203. package/dist/components/icons/Check.stories.js +0 -22
  204. package/dist/components/icons/Facebook.stories.js +0 -21
  205. package/dist/components/icons/Facebook_Logo.png +0 -0
  206. package/dist/components/icons/Info.stories.js +0 -16
  207. package/dist/components/icons/Instagram.stories.js +0 -21
  208. package/dist/components/icons/LI-In-Bug.png +0 -0
  209. package/dist/components/icons/LinkIcon.stories.js +0 -21
  210. package/dist/components/icons/LinkedIn.stories.js +0 -16
  211. package/dist/components/icons/Medium.stories.js +0 -16
  212. package/dist/components/icons/Reddit.stories.js +0 -21
  213. package/dist/components/icons/Share.stories.js +0 -16
  214. package/dist/components/icons/Telegram-Logo.png +0 -0
  215. package/dist/components/icons/Telegram.stories.js +0 -16
  216. package/dist/components/icons/Twitter.stories.js +0 -21
  217. package/dist/components/icons/X-logo-black.png +0 -0
  218. package/dist/components/icons/X.stories.js +0 -16
  219. package/dist/components/icons/Youtube.stories.js +0 -21
  220. package/dist/components/icons/youtube_social_circle_red.png +0 -0
  221. package/dist/components/taxId/TaxId.stories.js +0 -50
  222. package/dist/components/video/Video.stories.js +0 -52
@@ -1,541 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.Analytic = void 0;
7
- var _Matomo = _interopRequireDefault(require("../MatomoConnect/Matomo"));
8
- var Moment = _interopRequireWildcard(require("moment"));
9
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
12
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
13
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
- const matomoConnect = new _Matomo.default();
15
- const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
16
- const monthsShort = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
17
- class Analytic {
18
- constructor() {
19
- _defineProperty(this, "CURRENT_DATE", void 0);
20
- _defineProperty(this, "START_DATE", void 0);
21
- _defineProperty(this, "VISITS_SUMMARY", {});
22
- _defineProperty(this, "TOTAL_SUMMARY", {});
23
- this.CURRENT_DATE = new Moment();
24
- this.START_DATE = this.CURRENT_DATE.clone().subtract(2, 'months');
25
- this.getSummary();
26
- }
27
- async getSummary() {
28
- this.TOTAL_SUMMARY = {
29
- visits: 0,
30
- bounce_count: 0,
31
- visit_length: 0,
32
- unique_visitors: 0,
33
- avg_time_on_site: 0
34
- };
35
- this.VISITS_SUMMARY = await matomoConnect.init(matomoConnect.GetVisitsSummary, 'month', "".concat(this.START_DATE.format('YYYY-MM-DD'), ",").concat(this.CURRENT_DATE.format('YYYY-MM-DD')));
36
- Object.keys(this.VISITS_SUMMARY).forEach(key => {
37
- this.TOTAL_SUMMARY.visits += this.VISITS_SUMMARY[key].nb_visits || 0;
38
- this.TOTAL_SUMMARY.bounce_count += this.VISITS_SUMMARY[key].bounce_count || 0;
39
- this.TOTAL_SUMMARY.visit_length += this.VISITS_SUMMARY[key].sum_visit_length || 0;
40
- this.TOTAL_SUMMARY.unique_visitors += this.VISITS_SUMMARY[key].nb_uniq_visitors || 0;
41
- this.TOTAL_SUMMARY.avg_time_on_site += this.VISITS_SUMMARY[key].avg_time_on_site || 0;
42
- });
43
- }
44
- static async getRealTimeUsersBasicGraph() {
45
- const lastMinute = await matomoConnect.init(matomoConnect.LiveGetCounters, 10, 'visitors');
46
- const lastHour = await matomoConnect.init(matomoConnect.LiveGetCounters, 60, 'visitors');
47
- const last2Hours = await matomoConnect.init(matomoConnect.LiveGetCounters, 120, 'visitors');
48
- const increase = Analytic.getIncrease(last2Hours, lastMinute);
49
- const object = {
50
- id: 'realTimeUsersStat',
51
- title: 'realtime users',
52
- value: lastMinute.toString(),
53
- percent: isNaN(increase) ? 0 : parseFloat(parseFloat(increase).toFixed(1)),
54
- chart: {
55
- id: 'realTimeUsersChart',
56
- fill: '#e4ecf9',
57
- stroke: '#0050ca',
58
- data: [{
59
- date: 1,
60
- value: last2Hours
61
- }, {
62
- date: 2,
63
- value: lastHour
64
- }, {
65
- date: 3,
66
- value: lastMinute
67
- }]
68
- }
69
- };
70
- return object;
71
- }
72
- async getBasicGraphs() {
73
- return [this.getTotalVisitsBasicGraph(), this.getBounceRateBasicGraph(), this.getVisitDurationBasicGraph()];
74
- }
75
- getTotalVisitsBasicGraph() {
76
- const totalVisitsChartData = [];
77
- Object.keys(this.VISITS_SUMMARY).forEach(key => {
78
- totalVisitsChartData.push({
79
- date: totalVisitsChartData.length + 1,
80
- value: this.VISITS_SUMMARY[key].nb_visits ? this.VISITS_SUMMARY[key].nb_visits : 0
81
- });
82
- });
83
- const visitsSummaryKeys = Object.keys(this.VISITS_SUMMARY);
84
- const previousMonth = this.VISITS_SUMMARY[visitsSummaryKeys[visitsSummaryKeys.length - 2]];
85
- const lastMonth = this.VISITS_SUMMARY[visitsSummaryKeys[visitsSummaryKeys.length - 1]];
86
- const totalVisitsIncrease = Analytic.getIncrease(previousMonth && previousMonth.nb_visits ? previousMonth.nb_visits : 0, lastMonth && lastMonth.nb_visits ? lastMonth.nb_visits : 0);
87
- return {
88
- id: 'totalVisitsStat',
89
- title: 'total visits',
90
- value: this.TOTAL_SUMMARY.visits.toString(),
91
- percent: isNaN(totalVisitsIncrease) ? 0 : parseFloat(parseFloat(totalVisitsIncrease).toFixed(1)),
92
- chart: {
93
- id: 'totalVisitsGraph',
94
- fill: '#fee8e8',
95
- stroke: '#ee220d',
96
- data: totalVisitsChartData
97
- }
98
- };
99
- }
100
- getBounceRateBasicGraph() {
101
- const bounceRateData = [];
102
- Object.keys(this.VISITS_SUMMARY).forEach(key => {
103
- bounceRateData.push({
104
- date: bounceRateData.length + 1,
105
- value: this.VISITS_SUMMARY[key].bounce_count ? this.VISITS_SUMMARY[key].bounce_count : 0
106
- });
107
- });
108
- const visitsSummaryKeys = Object.keys(this.VISITS_SUMMARY);
109
- const firstMonth = this.VISITS_SUMMARY[visitsSummaryKeys.shift()];
110
- const lastMonth = this.VISITS_SUMMARY[visitsSummaryKeys[visitsSummaryKeys.length - 1]];
111
- const bounceRateIncrease = Analytic.getIncrease(firstMonth && firstMonth.bounce_count ? firstMonth.bounce_count : 0, lastMonth && lastMonth.bounce_count ? lastMonth.bounce_count : 0);
112
- const bounceRate = Analytic.getPercent(this.TOTAL_SUMMARY.bounce_count, this.TOTAL_SUMMARY.visits);
113
- return {
114
- id: 'bounceRateStat',
115
- title: 'bounce rate',
116
- value: "".concat(bounceRate, "%"),
117
- percent: isNaN(bounceRateIncrease) ? 0 : parseFloat(parseFloat(bounceRateIncrease).toFixed(1)),
118
- chart: {
119
- id: 'bounceRateGraph',
120
- fill: '#eff8ec',
121
- stroke: '#69bd53',
122
- data: bounceRateData
123
- }
124
- };
125
- }
126
- getVisitDurationBasicGraph() {
127
- const visitDurationData = [];
128
- Object.keys(this.VISITS_SUMMARY).forEach(key => {
129
- visitDurationData.push({
130
- date: visitDurationData.length + 1,
131
- value: this.VISITS_SUMMARY[key].avg_time_on_site ? this.VISITS_SUMMARY[key].avg_time_on_site : 0
132
- });
133
- });
134
- const visitsSummaryKeys = Object.keys(this.VISITS_SUMMARY);
135
- const firstMonth = this.VISITS_SUMMARY[visitsSummaryKeys.shift()];
136
- const lastMonth = this.VISITS_SUMMARY[visitsSummaryKeys[visitsSummaryKeys.length - 1]];
137
- const visitDurationIncrease = Analytic.getIncrease(firstMonth && firstMonth.avg_time_on_site ? firstMonth.avg_time_on_site : 0, lastMonth && lastMonth.avg_time_on_site ? lastMonth.avg_time_on_site : 0);
138
- const value = new Moment().startOf('day').seconds(this.TOTAL_SUMMARY.avg_time_on_site);
139
- return {
140
- id: 'visitDurationStat',
141
- title: 'avg. visit duration',
142
- value: Analytic.getTimeSpent(value),
143
- percent: isNaN(visitDurationIncrease) ? 0 : parseFloat(parseFloat(visitDurationIncrease).toFixed(1)),
144
- chart: {
145
- id: 'visitDurationGraph',
146
- fill: '#f0f0f0',
147
- stroke: '#2f2f2f',
148
- data: visitDurationData
149
- }
150
- };
151
- }
152
- async getCountryGraph() {
153
- const graphData = [];
154
- const countries = await matomoConnect.init(matomoConnect.GetCountrySummary, 'range', "".concat(this.START_DATE.format('YYYY-MM-DD'), ",").concat(this.CURRENT_DATE.format('YYYY-MM-DD')));
155
- const countriesByMonth = await matomoConnect.init(matomoConnect.GetCountrySummary, 'month', "".concat(this.START_DATE.format('YYYY-MM-DD'), ",").concat(this.CURRENT_DATE.format('YYYY-MM-DD')));
156
- countries.forEach((value, key) => {
157
- const bounceRateData = [];
158
- let bounceRate = value.bounce_count * 100 / value.nb_visits;
159
- bounceRate = parseFloat(bounceRate).toFixed(2);
160
- Object.keys(countriesByMonth).forEach(byMonthKey => {
161
- const object = {
162
- date: bounceRateData.length + 1
163
- };
164
- countriesByMonth[byMonthKey].forEach(cv => {
165
- if (cv.code === value.code) {
166
- object.value = cv && cv.bounce_count ? cv.bounce_count : 0;
167
- }
168
- });
169
- if (!object.value) {
170
- object.value = 0;
171
- }
172
- bounceRateData.push(object);
173
- });
174
- graphData.push({
175
- id: key,
176
- country: value.code,
177
- country_name: value.label,
178
- visits: value.nb_visits,
179
- unique_visitors: value.sum_daily_nb_uniq_visitors,
180
- flag_url: "".concat(matomoConnect.MATOMO_API_URL, "/").concat(value.logo),
181
- bounce_rate: "".concat(bounceRate, "%"),
182
- chart: {
183
- id: "countryChart".concat(key),
184
- fill: '#E4ECF9',
185
- stroke: '#0050CA',
186
- data: bounceRateData
187
- }
188
- });
189
- });
190
- return graphData;
191
- }
192
- async getSocialGraph() {
193
- const graphData = [];
194
- const socials = await matomoConnect.init(matomoConnect.GetSocialSummary, 'range', "".concat(this.START_DATE.format('YYYY-MM-DD'), ",").concat(this.CURRENT_DATE.format('YYYY-MM-DD')));
195
- socials.forEach((value, key) => {
196
- let progress = value.sum_daily_nb_uniq_visitors * 100 / this.TOTAL_SUMMARY.unique_visitors;
197
- progress = parseFloat(progress).toFixed(2);
198
- graphData.push({
199
- id: key,
200
- network: "".concat(value.label.charAt(0).toUpperCase()).concat(value.label.slice(1)),
201
- visitors: value.sum_daily_nb_uniq_visitors,
202
- progress: parseFloat(progress)
203
- });
204
- });
205
- return graphData;
206
- }
207
- async getDeviceGraph() {
208
- const devices = await matomoConnect.init(matomoConnect.GetDeviceOsFamilies, 'range', "".concat(this.START_DATE.format('YYYY-MM-DD'), ",").concat(this.CURRENT_DATE.format('YYYY-MM-DD')));
209
- const browsers = await matomoConnect.init(matomoConnect.GetDeviceBrowsers, 'range', "".concat(this.START_DATE.format('YYYY-MM-DD'), ",").concat(this.CURRENT_DATE.format('YYYY-MM-DD')));
210
- const models = await matomoConnect.init(matomoConnect.GetDeviceModels, 'range', "".concat(this.START_DATE.format('YYYY-MM-DD'), ",").concat(this.CURRENT_DATE.format('YYYY-MM-DD')));
211
- let desktop = 0;
212
- let android = 0;
213
- let ios = 0;
214
- let other = 0;
215
- let total = 0;
216
- devices.forEach((value, key) => {
217
- if (value.label === 'Android') {
218
- android += value.nb_visits;
219
- }
220
- if (value.label === 'iOS') {
221
- ios += value.nb_visits;
222
- }
223
- if (value.label === 'Windows' || value.label === 'Mac' || value.label === 'GNU/Linux') {
224
- desktop += value.nb_visits;
225
- }
226
- if (!['Windows', 'Mac', 'GNU/Linux', 'Android', 'iOS'].includes(value.label)) {
227
- other += value.nb_visits;
228
- }
229
- });
230
- total = android + ios + desktop + other;
231
- const donutChart = [{
232
- name: 'Android',
233
- value: android,
234
- color: '#0050CA'
235
- }, {
236
- name: 'Other',
237
- value: other,
238
- color: '#69BD53'
239
- }, {
240
- name: 'IOS',
241
- value: ios,
242
- color: '#CEDDF5'
243
- }, {
244
- name: 'Desktop',
245
- value: desktop,
246
- color: '#EE220D'
247
- }];
248
- const deviceData = {
249
- Android: {
250
- percent: Analytic.getPercent(android, total),
251
- value: android
252
- },
253
- iOS: {
254
- percent: Analytic.getPercent(ios, total),
255
- value: ios
256
- },
257
- Desktop: {
258
- percent: Analytic.getPercent(desktop, total),
259
- value: desktop
260
- },
261
- Other: {
262
- percent: Analytic.getPercent(other, total),
263
- value: other
264
- }
265
- };
266
- const desktopBrowsers = [];
267
- let desktopBrowsersTotal = 0;
268
- browsers.forEach((value, key) => {
269
- if (['Chrome', 'Firefox', 'Safari', 'Opera', 'Internet Explorer', 'Microsoft Edge', 'Vivaldi'].includes(value.label)) {
270
- desktopBrowsersTotal += value.nb_visits;
271
- }
272
- });
273
- browsers.forEach((value, key) => {
274
- if (['Chrome', 'Firefox', 'Safari', 'Opera', 'Internet Explorer', 'Microsoft Edge', 'Vivaldi'].includes(value.label)) {
275
- desktopBrowsers.push({
276
- label: value.label,
277
- value: "".concat(value.nb_visits, " (").concat(Analytic.getPercent(value.nb_visits, desktopBrowsersTotal), "%)")
278
- });
279
- }
280
- });
281
- const iosModels = [];
282
- let iosTotal = 0;
283
- const androidModels = [];
284
- let androidTotal = 0;
285
- models.forEach((value, key) => {
286
- if (!value.label.includes('Generic') && value.label.includes('Apple')) {
287
- iosTotal += value.nb_visits;
288
- }
289
- if (!value.label.includes('Generic') && !value.label.includes('Apple')) {
290
- androidTotal += value.nb_visits;
291
- }
292
- });
293
- models.forEach((value, key) => {
294
- if (!value.label.includes('Generic') && value.label.includes('Apple')) {
295
- iosModels.push({
296
- label: value.label,
297
- value: "".concat(value.nb_visits, " (").concat(Analytic.getPercent(value.nb_visits, iosTotal), "%)")
298
- });
299
- }
300
- if (!value.label.includes('Generic') && !value.label.includes('Apple')) {
301
- androidModels.push({
302
- label: value.label,
303
- value: "".concat(value.nb_visits, " (").concat(Analytic.getPercent(value.nb_visits, androidTotal), "%)")
304
- });
305
- }
306
- });
307
- return {
308
- donutChart,
309
- deviceData,
310
- desktopBrowsers,
311
- iosModels,
312
- androidModels
313
- };
314
- }
315
- async getMonthSlider() {
316
- const response = await matomoConnect.init(matomoConnect.GetVisitsSummary, 'day', "".concat(this.START_DATE.format('YYYY-MM-DD'), ",").concat(this.CURRENT_DATE.format('YYYY-MM-DD')));
317
- const data = [];
318
- Object.keys(response).forEach(key => {
319
- const month = key.split('-');
320
- let check = false;
321
- data.forEach((value, k) => {
322
- if (value.title === "".concat(months[parseInt(month[1], 10) - 1], " ").concat(month[0])) {
323
- check = true;
324
- }
325
- });
326
- if (!check) {
327
- data.push({
328
- title: "".concat(months[parseInt(month[1], 10) - 1], " ").concat(month[0]),
329
- values: [],
330
- total: 0
331
- });
332
- }
333
- data.forEach((value, k) => {
334
- if (value.title === "".concat(months[parseInt(month[1], 10) - 1], " ").concat(month[0])) {
335
- value.values.push({
336
- name: key.split('-')[2],
337
- value: response[key].nb_uniq_visitors ? response[key].nb_uniq_visitors : 0
338
- });
339
- value.total += response[key].nb_uniq_visitors ? response[key].nb_uniq_visitors : 0;
340
- }
341
- });
342
- });
343
- return data.reverse();
344
- }
345
- async getYearSlider() {
346
- const data = [];
347
- const response = await this.getMonthSlider();
348
- response && response.reverse().forEach(month => {
349
- const year = month.title.split(' ');
350
- let check = false;
351
- data.forEach((value, k) => {
352
- if (value.title === "".concat(year[1])) {
353
- check = true;
354
- }
355
- });
356
- if (!check) {
357
- data.push({
358
- title: "".concat(year[1]),
359
- values: []
360
- });
361
- }
362
- data.forEach((value, k) => {
363
- if (value.title === "".concat(year[1])) {
364
- value.values.push({
365
- name: "".concat(year[0]),
366
- value: month.total || 0
367
- });
368
- }
369
- });
370
- });
371
- return data.reverse();
372
- }
373
- async getWeekSlider() {
374
- const response = await matomoConnect.init(matomoConnect.GetVisitsSummary, 'day', "".concat(this.START_DATE.format('YYYY-MM-DD'), ",").concat(this.CURRENT_DATE.format('YYYY-MM-DD')));
375
- const data = [];
376
- Object.keys(response).forEach(key => {
377
- const startOfWeek = Moment(key).startOf('isoWeek');
378
- const endOfWeek = Moment(key).endOf('isoWeek');
379
- const slicedStartOfWeek = startOfWeek.toString().slice(4, 10); //15)
380
- const slicedEndOfWeek = endOfWeek.toString().slice(4, 10); //15)
381
-
382
- const day = Moment(key).format('ddd');
383
- let check = false;
384
- data.forEach((value, k) => {
385
- if (value.title === "".concat(slicedStartOfWeek, " - ").concat(slicedEndOfWeek)) {
386
- check = true;
387
- }
388
- });
389
- if (!check) {
390
- data.push({
391
- title: "".concat(slicedStartOfWeek, " - ").concat(slicedEndOfWeek),
392
- values: []
393
- });
394
- }
395
- data.forEach((value, k) => {
396
- if (value.title === "".concat(slicedStartOfWeek, " - ").concat(slicedEndOfWeek)) {
397
- value.values.push({
398
- name: day,
399
- value: response[key].nb_uniq_visitors ? response[key].nb_uniq_visitors : 0
400
- });
401
- }
402
- });
403
- });
404
- return data.reverse();
405
- }
406
- async getHeatmap() {
407
- const periods = {
408
- '00': {
409
- value: '12AM'
410
- },
411
- '01': {
412
- value: '1AM'
413
- },
414
- '02': {
415
- value: '2AM'
416
- },
417
- '03': {
418
- value: '3AM'
419
- },
420
- '04': {
421
- value: '4AM'
422
- },
423
- '05': {
424
- value: '5AM'
425
- },
426
- '06': {
427
- value: '6AM'
428
- },
429
- '07': {
430
- value: '7AM'
431
- },
432
- '08': {
433
- value: '8AM'
434
- },
435
- '09': {
436
- value: '9AM'
437
- },
438
- 10: {
439
- value: '10AM'
440
- },
441
- 11: {
442
- value: '11AM'
443
- },
444
- 12: {
445
- value: '12PM'
446
- },
447
- 13: {
448
- value: '1PM'
449
- },
450
- 14: {
451
- value: '2PM'
452
- },
453
- 15: {
454
- value: '3PM'
455
- },
456
- 16: {
457
- value: '4PM'
458
- },
459
- 17: {
460
- value: '5PM'
461
- },
462
- 18: {
463
- value: '6PM'
464
- },
465
- 19: {
466
- value: '7PM'
467
- },
468
- 20: {
469
- value: '8PM'
470
- },
471
- 21: {
472
- value: '9PM'
473
- },
474
- 22: {
475
- value: '10PM'
476
- },
477
- 23: {
478
- value: '11PM'
479
- },
480
- 24: {
481
- value: '12PM'
482
- }
483
- };
484
- const uniqueData = {};
485
- const response = await matomoConnect.init(matomoConnect.GetVisitTimePerLocalTime, 'day', "".concat(this.START_DATE.format('YYYY-MM-DD'), ",").concat(this.CURRENT_DATE.format('YYYY-MM-DD')));
486
- Object.keys(response).forEach(key => {
487
- const time = new Moment(key);
488
- response[key].forEach((hour, k) => {
489
- const day = time.format('ddd').toUpperCase();
490
- const uniqueId = "".concat(day, "-").concat(hour.label);
491
- if (uniqueData[uniqueId] !== undefined) {
492
- const datum = uniqueData[uniqueId];
493
- // calculate an average value for all redundant data
494
- datum.value = (datum.dataCount * datum.value + hour.nb_uniq_visitors) / (datum.dataCount + 1);
495
- datum.dataCount += 1;
496
- } else {
497
- uniqueData[uniqueId] = {
498
- group: day,
499
- variable: periods[hour.label].value,
500
- value: hour.nb_uniq_visitors,
501
- dataCount: 1
502
- };
503
- }
504
- });
505
- });
506
- const data = Object.keys(uniqueData).map(uniqueId => {
507
- const datum = uniqueData[uniqueId];
508
- return {
509
- group: datum.group,
510
- variable: datum.variable,
511
- value: datum.value
512
- };
513
- });
514
- return data;
515
- }
516
- static getPercent(number, total) {
517
- let percent = number * 100 / total;
518
- percent = parseFloat(percent).toFixed(2);
519
- return isNaN(parseFloat(percent)) ? 0 : parseFloat(percent);
520
- }
521
- static getIncrease() {
522
- let min = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
523
- let max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
524
- let increase = max - min;
525
- increase = increase / min * 100;
526
- return increase === Infinity && increase > 100 ? 100 : increase;
527
- }
528
- static getTimeSpent(value) {
529
- let hours = '';
530
- let minutes = '';
531
- if (value.format('H') !== 0) {
532
- hours = "".concat(value.format('H'), "h ");
533
- }
534
- if (value.format('m') !== 0) {
535
- minutes = "".concat(value.format('m'), "m ");
536
- }
537
- return "".concat(hours).concat(minutes).concat(value.format('s'), "s");
538
- }
539
- }
540
- exports.Analytic = Analytic;
541
- var _default = exports.default = Analytic;
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.ChartContainer = void 0;
7
- var _styledComponents = _interopRequireDefault(require("styled-components"));
8
- var _ComponentWrapper = _interopRequireDefault(require("../ComponentWrapper/ComponentWrapper.styles"));
9
- var _theme = _interopRequireDefault(require("../../styles/theme"));
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- const colorTheme = props => ({
12
- blue: {
13
- primary: _theme.default.cPrimary,
14
- dark: _theme.default.cPrimaryDark
15
- },
16
- red: {
17
- primary: _theme.default.cWarning,
18
- dark: _theme.default.cWarningDark
19
- }
20
- });
21
- const ChartContainer = exports.ChartContainer = (0, _styledComponents.default)(_ComponentWrapper.default).withConfig({
22
- displayName: "Analyticstyles__ChartContainer",
23
- componentId: "sc-wgv3ti-0"
24
- })([".slick-arrow{width:64px;height:48px;background:", ";z-index:10;transition:0.3s ease background;margin-top:10px;&:hover,&:focus{background:", ";&::before{color:", " !important;}}}.slick-arrow.slick-prev{top:auto;left:auto;bottom:0;right:64px;transform:translateY(100%);}.slick-arrow.slick-next{top:auto;left:auto;bottom:0;right:0;transform:translateY(100%);border-left:1px solid ", ";}"], props => colorTheme(props)[props.colorTheme].primary, props => colorTheme(props)[props.colorTheme].dark, props => _theme.default.cWhite, props => colorTheme(props)[props.colorTheme].dark);
25
- var _default = exports.default = ChartContainer;
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.BackButtonDefault = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _BackButton = require("./BackButton");
9
- var _ComponentWrapper = require("../ComponentWrapper/ComponentWrapper.styles");
10
- var _global = _interopRequireDefault(require("../../styles/global"));
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- var _default = exports.default = {
13
- title: 'Components Library/Buttons/BackButton',
14
- component: _BackButton.BackButton,
15
- argTypes: {
16
- children: {
17
- type: 'node',
18
- required: true
19
- },
20
- to: {
21
- type: 'string'
22
- },
23
- href: {
24
- type: 'string'
25
- }
26
- }
27
- };
28
- const Template = args => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_BackButton.BackButton, args)));
29
- const BackButtonDefault = exports.BackButtonDefault = Template.bind({});
30
- BackButtonDefault.args = {};
31
-
32
- //back button by default links to any page visited before
@@ -1,75 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.BackgroundMobile2 = exports.BackgroundMobile = exports.BackgroundDefault = void 0;
7
- var _viewport = require("storybook/viewport");
8
- var _react = _interopRequireDefault(require("react"));
9
- var _Background = require("./Background");
10
- var _global = _interopRequireDefault(require("../../styles/global"));
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- var _default = exports.default = {
13
- title: 'Components Library/Background',
14
- component: _Background.Background,
15
- argTypes: {
16
- src: {
17
- type: 'string',
18
- required: true,
19
- defaultValue: 'https://www.cookingclassy.com/wp-content/uploads/2014/06/chocolate-chip-cookie-16.jpg'
20
- },
21
- mobileRatio: {
22
- type: 'string',
23
- defaultValue: ''
24
- },
25
- children: {
26
- type: 'node',
27
- defaultValue: /*#__PURE__*/_react.default.createElement("div", null)
28
- },
29
- investmentOpportunities: {
30
- type: 'node'
31
- },
32
- caption: {
33
- type: 'string',
34
- defaultValue: ''
35
- }
36
- },
37
- parameters: {
38
- viewport: {
39
- viewports: _viewport.INITIAL_VIEWPORTS,
40
- defaultViewport: ''
41
- }
42
- }
43
- };
44
- const Template = args => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(_Background.Background, args, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null)));
45
- const BackgroundDefault = exports.BackgroundDefault = Template.bind({});
46
- BackgroundDefault.args = {
47
- src: 'https://www.cookingclassy.com/wp-content/uploads/2014/06/chocolate-chip-cookie-16.jpg'
48
- };
49
- BackgroundDefault.parameters = {
50
- viewport: {
51
- defaultViewport: 'reset viewport'
52
- }
53
- };
54
- const BackgroundMobile = exports.BackgroundMobile = Template.bind({});
55
- BackgroundMobile.args = {
56
- mobileRatio: '16:9',
57
- children: /*#__PURE__*/_react.default.createElement("div", null)
58
- };
59
- BackgroundMobile.parameters = {
60
- viewport: {
61
- defaultViewport: 'iphonex'
62
- }
63
- };
64
- const BackgroundMobile2 = exports.BackgroundMobile2 = Template.bind({});
65
- BackgroundMobile2.args = {
66
- mobileRatio: '16:9',
67
- contain: true,
68
- withPadding: true,
69
- caption: 'AMP ID at the top right of your SideSwap wallet.'
70
- };
71
- BackgroundMobile2.parameters = {
72
- viewport: {
73
- defaultViewport: 'iphonex'
74
- }
75
- };