@mx-cartographer/experiences 9.7.206 → 10.0.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 (259) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +2 -0
  3. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.es.js +39 -23
  4. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.es.js.map +1 -1
  5. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +3 -1
  6. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.es.js +37 -33
  7. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.es.js.map +1 -1
  8. package/dist/accounts/utils/AccountFields.d.ts +3 -1
  9. package/dist/accounts/utils/AccountFields.es.js +39 -39
  10. package/dist/accounts/utils/AccountFields.es.js.map +1 -1
  11. package/dist/common/components/charts/LineChart.d.ts +4 -0
  12. package/dist/common/components/charts/LineChart.es.js +114 -112
  13. package/dist/common/components/charts/LineChart.es.js.map +1 -1
  14. package/dist/common/components/charts/linechart/CustomLegend.es.js +24 -21
  15. package/dist/common/components/charts/linechart/CustomLegend.es.js.map +1 -1
  16. package/dist/core/types/Insights.d.ts +9 -1
  17. package/dist/core/types/Insights.es.js.map +1 -1
  18. package/dist/core/types/localization/InsightsFeedCopy.d.ts +42 -0
  19. package/dist/core/types/localization/index.d.ts +1 -1
  20. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.d.ts +7 -1
  21. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js +39 -20
  22. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js.map +1 -1
  23. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsIncomeChart.d.ts +4 -0
  24. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsIncomeChart.es.js +42 -0
  25. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsIncomeChart.es.js.map +1 -0
  26. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsPaymentChart.d.ts +7 -0
  27. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsPaymentChart.es.js +54 -0
  28. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsPaymentChart.es.js.map +1 -0
  29. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +10 -10
  30. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.es.js +24 -23
  31. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.es.js.map +1 -1
  32. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +75 -73
  33. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
  34. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.d.ts +5 -1
  35. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.es.js +21 -21
  36. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.es.js.map +1 -1
  37. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.d.ts +11 -0
  38. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.es.js +65 -58
  39. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.es.js.map +1 -1
  40. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsV2.es.js +17 -17
  41. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsV2.es.js.map +1 -1
  42. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/BalanceStepper.es.js +9 -10
  43. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/BalanceStepper.es.js.map +1 -1
  44. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js +21 -22
  45. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js.map +1 -1
  46. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js +35 -35
  47. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js.map +1 -1
  48. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.d.ts +1 -1
  49. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.es.js +44 -49
  50. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.es.js.map +1 -1
  51. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.d.ts +1 -1
  52. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js +19 -16
  53. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js.map +1 -1
  54. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.d.ts +2 -2
  55. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js +212 -166
  56. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js.map +1 -1
  57. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/StepIcon.d.ts +4 -0
  58. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/StepIcon.es.js +24 -0
  59. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/StepIcon.es.js.map +1 -0
  60. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.d.ts +6 -5
  61. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.es.js +38 -38
  62. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.es.js.map +1 -1
  63. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +1 -1
  64. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.d.ts +1 -5
  65. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js +37 -36
  66. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js.map +1 -1
  67. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.d.ts +9 -11
  68. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js +12 -6
  69. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js.map +1 -1
  70. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +46 -40
  71. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
  72. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +141 -126
  73. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
  74. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +8 -1
  75. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +243 -200
  76. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  77. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +2 -0
  78. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
  79. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js +54 -53
  80. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js.map +1 -1
  81. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.d.ts +6 -1
  82. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js +14 -13
  83. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js.map +1 -1
  84. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.d.ts +4 -3
  85. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js +24 -21
  86. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js.map +1 -1
  87. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.d.ts +14 -4
  88. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js +79 -67
  89. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js.map +1 -1
  90. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.d.ts +3 -1
  91. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.es.js +48 -32
  92. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.es.js.map +1 -1
  93. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js +19 -14
  94. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js.map +1 -1
  95. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.d.ts +4 -0
  96. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.es.js +19 -15
  97. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.es.js.map +1 -1
  98. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js +26 -19
  99. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js.map +1 -1
  100. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.d.ts +1 -0
  101. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js +17 -21
  102. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js.map +1 -1
  103. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/StepChartBlock.d.ts +1 -1
  104. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js +11 -11
  105. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js.map +1 -1
  106. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/index.es.js +15 -11
  107. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/index.es.js.map +1 -1
  108. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/layout.d.ts +20 -0
  109. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/layout.es.js +21 -0
  110. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/layout.es.js.map +1 -0
  111. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.d.ts +2 -4
  112. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.es.js +78 -82
  113. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.es.js.map +1 -1
  114. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/WithText.d.ts +10 -2
  115. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/WithText.es.js +115 -54
  116. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/WithText.es.js.map +1 -1
  117. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.d.ts +1 -1
  118. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +37 -36
  119. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js.map +1 -1
  120. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +27 -22
  121. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
  122. package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js +8 -8
  123. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.d.ts +7 -0
  124. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.es.js +46 -0
  125. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.es.js.map +1 -0
  126. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/index.d.ts +3 -0
  127. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.d.ts +13 -0
  128. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.es.js +22 -0
  129. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.es.js.map +1 -0
  130. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js +29 -21
  131. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js.map +1 -1
  132. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.d.ts +0 -2
  133. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js +17 -21
  134. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js.map +1 -1
  135. package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.es.js +5 -6
  136. package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.es.js.map +1 -1
  137. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.d.ts +3 -7
  138. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.es.js +120 -306
  139. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.es.js.map +1 -1
  140. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/RatingScale.d.ts +17 -0
  141. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/RatingScale.es.js +93 -0
  142. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/RatingScale.es.js.map +1 -0
  143. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/StepBar.d.ts +5 -0
  144. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/StepBar.es.js +21 -0
  145. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/StepBar.es.js.map +1 -0
  146. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/SurveyResult.d.ts +18 -0
  147. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/SurveyResult.es.js +71 -0
  148. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/SurveyResult.es.js.map +1 -0
  149. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.d.ts +82 -8
  150. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.es.js +66 -15
  151. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.es.js.map +1 -1
  152. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +46 -63
  153. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js.map +1 -1
  154. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.d.ts +3 -3
  155. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js +44 -53
  156. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js.map +1 -1
  157. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.d.ts +1 -1
  158. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js +30 -31
  159. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js.map +1 -1
  160. package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js +25 -20
  161. package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js.map +1 -1
  162. package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/layout.d.ts +22 -0
  163. package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/layout.es.js +24 -0
  164. package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/layout.es.js.map +1 -0
  165. package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/StrategiesBlock.d.ts +7 -0
  166. package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/StrategiesBlock.es.js +89 -0
  167. package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/StrategiesBlock.es.js.map +1 -0
  168. package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/index.d.ts +1 -0
  169. package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/layout.d.ts +43 -0
  170. package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/layout.es.js +28 -0
  171. package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/layout.es.js.map +1 -0
  172. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +54 -53
  173. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
  174. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +7 -3
  175. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +20 -11
  176. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
  177. package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js +29 -28
  178. package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js.map +1 -1
  179. package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +2 -0
  180. package/dist/insights-v2/blocks/ImageBlocks/ImageBlock.es.js +6 -5
  181. package/dist/insights-v2/blocks/ImageBlocks/ImageBlock.es.js.map +1 -1
  182. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/FederalBankHoliday.es.js +117 -71
  183. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/FederalBankHoliday.es.js.map +1 -1
  184. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.d.ts +1 -1
  185. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.es.js +10 -7
  186. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.es.js.map +1 -1
  187. package/dist/insights-v2/components/AccountHeroCard.d.ts +3 -1
  188. package/dist/insights-v2/components/AccountHeroCard.es.js.map +1 -1
  189. package/dist/insights-v2/components/BaseLayout.d.ts +3 -1
  190. package/dist/insights-v2/components/BaseLayout.es.js +134 -119
  191. package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
  192. package/dist/insights-v2/components/CompactDirectDepositCard.d.ts +28 -0
  193. package/dist/insights-v2/components/CompactDirectDepositCard.es.js +78 -0
  194. package/dist/insights-v2/components/CompactDirectDepositCard.es.js.map +1 -0
  195. package/dist/insights-v2/components/CompactInsightCard.es.js +122 -118
  196. package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
  197. package/dist/insights-v2/components/DirectDepositCard.d.ts +6 -1
  198. package/dist/insights-v2/components/DirectDepositCard.es.js +24 -22
  199. package/dist/insights-v2/components/DirectDepositCard.es.js.map +1 -1
  200. package/dist/insights-v2/components/LoadingCard.es.js +13 -9
  201. package/dist/insights-v2/components/LoadingCard.es.js.map +1 -1
  202. package/dist/insights-v2/components/LogoFromGuid.d.ts +1 -1
  203. package/dist/insights-v2/components/LogoFromGuid.es.js.map +1 -1
  204. package/dist/insights-v2/components/MerchantHighlightCard.es.js +4 -4
  205. package/dist/insights-v2/components/SaveAnExtraCard.d.ts +4 -1
  206. package/dist/insights-v2/components/SaveAnExtraCard.es.js +32 -20
  207. package/dist/insights-v2/components/SaveAnExtraCard.es.js.map +1 -1
  208. package/dist/insights-v2/components/SubTabs.d.ts +2 -1
  209. package/dist/insights-v2/components/SubTabs.es.js +29 -24
  210. package/dist/insights-v2/components/SubTabs.es.js.map +1 -1
  211. package/dist/insights-v2/components/TransactionListCard.d.ts +3 -1
  212. package/dist/insights-v2/components/TransactionListCard.es.js +39 -37
  213. package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
  214. package/dist/insights-v2/components/TransferLogoCard.es.js +1 -0
  215. package/dist/insights-v2/components/TransferLogoCard.es.js.map +1 -1
  216. package/dist/insights-v2/components/UpcomingBillCard.es.js +39 -35
  217. package/dist/insights-v2/components/UpcomingBillCard.es.js.map +1 -1
  218. package/dist/insights-v2/components/celebrationGradients.d.ts +17 -8
  219. package/dist/insights-v2/components/celebrationGradients.es.js +14 -14
  220. package/dist/insights-v2/components/celebrationGradients.es.js.map +1 -1
  221. package/dist/insights-v2/components/chartblocks/ChartLegend.es.js +16 -10
  222. package/dist/insights-v2/components/chartblocks/ChartLegend.es.js.map +1 -1
  223. package/dist/insights-v2/components/chartblocks/DoubleBarChart.d.ts +10 -4
  224. package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js +62 -61
  225. package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js.map +1 -1
  226. package/dist/insights-v2/components/chartblocks/EmptyBarChart.es.js +13 -6
  227. package/dist/insights-v2/components/chartblocks/EmptyBarChart.es.js.map +1 -1
  228. package/dist/insights-v2/components/shared/images/DesignateEmergencySavings.es.js +2 -3
  229. package/dist/insights-v2/components/shared/images/DesignateEmergencySavings.es.js.map +1 -1
  230. package/dist/insights-v2/components/statusIcon.d.ts +2 -1
  231. package/dist/insights-v2/components/statusIcon.es.js +10 -8
  232. package/dist/insights-v2/components/statusIcon.es.js.map +1 -1
  233. package/dist/insights-v2/ctaActions/ctaConfig.es.js +19 -17
  234. package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
  235. package/dist/insights-v2/ctaActions/ctaHandlers.d.ts +5 -1
  236. package/dist/insights-v2/ctaActions/ctaHandlers.es.js +71 -54
  237. package/dist/insights-v2/ctaActions/ctaHandlers.es.js.map +1 -1
  238. package/dist/insights-v2/ctaActions/ctaPostMessages.es.js +41 -24
  239. package/dist/insights-v2/ctaActions/ctaPostMessages.es.js.map +1 -1
  240. package/dist/insights-v2/ctaActions/feedbackSurvey.d.ts +9 -0
  241. package/dist/insights-v2/ctaActions/feedbackSurvey.es.js +51 -0
  242. package/dist/insights-v2/ctaActions/feedbackSurvey.es.js.map +1 -0
  243. package/dist/insights-v2/ctaActions/runCtaAction.es.js +36 -35
  244. package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
  245. package/dist/insights-v2/ctaActions/types.d.ts +7 -0
  246. package/dist/insights-v2/index.es.js +126 -120
  247. package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -1
  248. package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -1
  249. package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
  250. package/dist/insights-v2/mappings/blocks.es.js +126 -122
  251. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  252. package/dist/microinsights/MicroCardTemplate.es.js +1 -1
  253. package/dist/microinsights/MicroCardTemplate.es.js.map +1 -1
  254. package/dist/microinsights/cards/InsightCard.es.js +53 -53
  255. package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
  256. package/package.json +1 -1
  257. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/index.d.ts +0 -13
  258. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/DesignateEmergencySavingsAccount.es.js +0 -296
  259. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/DesignateEmergencySavingsAccount.es.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RatingScale.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/FeedbackBlock/RatingScale.tsx"],"sourcesContent":["import { type KeyboardEvent, type RefObject, useRef } from 'react'\n\nimport ButtonBase from '@mui/material/ButtonBase'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nconst RATINGS = [1, 2, 3, 4, 5]\n\n// ARIA radio group keys: arrows step (wrapping), Home and End jump to the ends.\nconst KEY_STEPS: Record<string, number> = {\n ArrowDown: 1,\n ArrowLeft: -1,\n ArrowRight: 1,\n ArrowUp: -1,\n}\n\nconst keyTarget = (key: string, index: number) => {\n if (key === 'Home') return 0\n if (key === 'End') return RATINGS.length - 1\n if (key in KEY_STEPS) return (index + KEY_STEPS[key] + RATINGS.length) % RATINGS.length\n return undefined\n}\n\ninterface RatingScaleProps {\n ariaLabel: (rating: number) => string\n label: string\n maxLabel: string\n minLabel: string\n onChange: (rating: number) => void\n /** Receives the group's tab stop, for focus to land on when the step appears. */\n tabStopRef: RefObject<HTMLButtonElement | null>\n value?: number\n}\n\n/**\n * Figma \"Toggle | NumberRating\": five joined 44px cells, the picked one tinted primary, over its end\n * labels. A radio group: one tab stop (the picked cell, else the first); the arrow keys move and pick.\n */\nexport const RatingScale = ({\n ariaLabel,\n label,\n maxLabel,\n minLabel,\n onChange,\n tabStopRef,\n value,\n}: RatingScaleProps) => {\n const cells = useRef<(HTMLButtonElement | null)[]>([])\n const tabStop = value === undefined ? 0 : RATINGS.indexOf(value)\n\n const onKeyDown = (event: KeyboardEvent, index: number) => {\n const target = keyTarget(event.key, index)\n if (target === undefined) return\n event.preventDefault()\n cells.current[target]?.focus()\n onChange(RATINGS[target])\n }\n\n return (\n <Stack sx={{ gap: 6 }}>\n <Stack aria-label={label} direction=\"row\" role=\"radiogroup\">\n {RATINGS.map((rating, index) => {\n const selected = rating === value\n return (\n <ButtonBase\n aria-checked={selected}\n aria-label={ariaLabel(rating)}\n key={rating}\n onClick={() => onChange(rating)}\n onKeyDown={(event) => onKeyDown(event, index)}\n ref={(cell) => {\n cells.current[index] = cell\n if (index === tabStop) tabStopRef.current = cell\n }}\n role=\"radio\"\n sx={(theme) => ({\n bgcolor: selected\n ? alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity)\n : undefined,\n border: 1,\n borderColor: selected ? 'primary.main' : 'divider',\n color: 'primary.main',\n flex: 1,\n fontSize: 13,\n fontWeight: 600,\n height: 44,\n lineHeight: '16px',\n zIndex: selected ? 1 : 0,\n // Joined cells: one shared border between neighbours, the picked cell drawn on top.\n '&:not(:first-of-type)': { ml: '-1px' },\n '&:first-of-type': { borderBottomLeftRadius: 4, borderTopLeftRadius: 4 },\n '&:last-of-type': { borderBottomRightRadius: 4, borderTopRightRadius: 4 },\n // Inset, so the joined neighbours do not cover it; raised above the picked cell.\n '&.Mui-focusVisible': {\n outline: `2px solid ${theme.palette.info.main}`,\n outlineOffset: -2,\n zIndex: 2,\n },\n })}\n tabIndex={index === tabStop ? 0 : -1}\n >\n {rating}\n </ButtonBase>\n )\n })}\n </Stack>\n <Stack direction=\"row\" sx={{ justifyContent: 'space-between' }}>\n <Text color=\"text.secondary\" variant=\"caption\">\n {minLabel}\n </Text>\n <Text color=\"text.secondary\" variant=\"caption\">\n {maxLabel}\n </Text>\n </Stack>\n </Stack>\n )\n}\n"],"mappings":";;;;;;AAQA,IAAM,IAAU;AAAA,EAAC;AAAA,EAAG;AAAA,EAAG;AAAA,EAAG;AAAA,EAAG;AAAC,GAGxB,IAAoC;AAAA,EACxC,WAAW;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AACX,GAEM,IAAA,CAAa,GAAa,MAAkB;AAChD,MAAI,MAAQ,OAAQ,QAAO;AAC3B,MAAI,MAAQ,MAAO,QAAO,EAAQ,SAAS;AAC3C,MAAI,KAAO,EAAW,SAAQ,IAAQ,EAAU,CAAA,IAAO,EAAQ,UAAU,EAAQ;AAEnF,GAiBa,IAAA,CAAe,EAC1B,WAAA,GACA,OAAA,GACA,UAAA,GACA,UAAA,GACA,UAAA,GACA,YAAA,GACA,OAAA,EAAA,MACsB;AACtB,QAAM,IAAQ,EAAqC,CAAC,CAAC,GAC/C,IAAU,MAAU,SAAY,IAAI,EAAQ,QAAQ,CAA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sB;AAAA,cACpB,SAAS,aAAa,EAAM,QAAQ,KAAK,IAAA;AAAA,cACzC,eAAe;AAAA,cACf,QAAQ;AAAA,YACV;AAAA,UACF;AAAA,UACA,UAAU,MAAU,IAAU,IAAI;AAAA,UAEjC,UAAA;AAAA,QACS,GAnCL,CAmCK;AAAA,MAEhB,CAAC;AAAA,IACI,CAAA,GACP,gBAAA,EAAC,GAAD;AAAA,MAAO,WAAU;AAAA,MAAM,IAAI,EAAE,gBAAgB,gBAAgB;AAAA,MAA7D,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,QAAM,OAAM;AAAA,QAAiB,SAAQ;AAAA,QAClC,UAAA;AAAA,MACG,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,QAAM,OAAM;AAAA,QAAiB,SAAQ;AAAA,QAClC,UAAA;AAAA,MACG,CAAA,CACD;AAAA,IACF,CAAA,CAAA;AAAA;AAEX"}
@@ -0,0 +1,5 @@
1
+ /** The survey's progress: one segment per step, filled up to the current one. Decorative. */
2
+ export declare const StepBar: ({ step, steps }: {
3
+ step: number;
4
+ steps: number;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import i from "@mui/material/Stack";
2
+ import { jsx as a } from "react/jsx-runtime";
3
+ import p from "@mui/material/Box";
4
+ var f = ({ step: e, steps: t }) => /* @__PURE__ */ a(i, {
5
+ "aria-hidden": !0,
6
+ direction: "row",
7
+ sx: {
8
+ gap: 4,
9
+ height: 4
10
+ },
11
+ children: Array.from({ length: t }, (m, r) => /* @__PURE__ */ a(p, { sx: (o) => ({
12
+ bgcolor: r <= e ? "primary.main" : o.palette.grey[o.palette.mode === "dark" ? 500 : 300],
13
+ borderRadius: "24px",
14
+ flex: 1
15
+ }) }, r))
16
+ });
17
+ export {
18
+ f as StepBar
19
+ };
20
+
21
+ //# sourceMappingURL=StepBar.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StepBar.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/FeedbackBlock/StepBar.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\n\n/** The survey's progress: one segment per step, filled up to the current one. Decorative. */\nexport const StepBar = ({ step, steps }: { step: number; steps: number }) => (\n <Stack aria-hidden={true} direction=\"row\" sx={{ gap: 4, height: 4 }}>\n {Array.from({ length: steps }, (_, index) => (\n <Box\n key={index}\n sx={(theme) => ({\n // Figma `_components/stepper/inactive`: grey 300 light, 500 dark.\n bgcolor:\n index <= step\n ? 'primary.main'\n : theme.palette.grey[theme.palette.mode === 'dark' ? 500 : 300],\n borderRadius: '24px',\n flex: 1,\n })}\n />\n ))}\n </Stack>\n)\n"],"mappings":";;;AAIA,IAAa,IAAA,CAAW,EAAE,MAAA,GAAM,OAAA,EAAA,MAC9B,gBAAA,EAAC,GAAD;AAAA,EAAO,eAAa;AAAA,EAAM,WAAU;AAAA,EAAM,IAAI;AAAA,IAAE,KAAK;AAAA,IAAG,QAAQ;AAAA,EAAE;AAAA,EAC/D,UAAA,MAAM,KAAK,EAAE,QAAQ,EAAM,GAAA,CAAI,GAAG,MACjC,gBAAA,EAAC,GAAD,EAEE,IAAA,CAAK,OAAW;AAAA,IAEd,SACE,KAAS,IACL,iBACA,EAAM,QAAQ,KAAK,EAAM,QAAQ,SAAS,SAAS,MAAM,GAAA;AAAA,IAC/D,cAAc;AAAA,IACd,MAAM;AAAA,EACR,GACD,GAVM,CAUN,CACF;AACI,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { RefObject } from 'react';
2
+ interface SurveyResultProps {
3
+ bannerRef: RefObject<HTMLDivElement | null>;
4
+ message: string;
5
+ severity: 'success' | 'error';
6
+ /** The error's retry, under the message; disabled while `pending`. */
7
+ retry?: {
8
+ label: string;
9
+ pending: boolean;
10
+ onPress: () => void;
11
+ };
12
+ }
13
+ /**
14
+ * The survey's result, in place of its steps: Figma's <Snackbar> banner. Light mode draws white on
15
+ * the 600 tone; dark mode the main tone, where white fails AA, so black. The icon takes the same colour.
16
+ */
17
+ export declare const SurveyResult: ({ bannerRef, message, severity, retry }: SurveyResultProps) => import("react/jsx-runtime").JSX.Element;
18
+ export {};
@@ -0,0 +1,71 @@
1
+ import t from "@mui/material/Stack";
2
+ import { Text as a } from "@mxenabled/mxui";
3
+ import d from "@mui/material/Button";
4
+ import { Icon as h } from "@mxenabled/mx-icons";
5
+ import { jsx as o, jsxs as c } from "react/jsx-runtime";
6
+ import l from "@mui/material/Box";
7
+ var k = ({ bannerRef: s, message: m, severity: i, retry: n }) => /* @__PURE__ */ o(l, {
8
+ sx: {
9
+ pb: 16,
10
+ px: 16,
11
+ width: "100%"
12
+ },
13
+ children: /* @__PURE__ */ c(t, {
14
+ direction: "row",
15
+ ref: s,
16
+ role: i === "error" ? "alert" : "status",
17
+ sx: ({ palette: r }) => {
18
+ const e = r.mode === "dark";
19
+ return {
20
+ bgcolor: e ? r[i].main : r[i][600],
21
+ borderRadius: 1,
22
+ color: e ? r.common.black : r.common.white,
23
+ px: 16,
24
+ py: 8
25
+ };
26
+ },
27
+ tabIndex: -1,
28
+ children: [/* @__PURE__ */ o(l, {
29
+ sx: {
30
+ flexShrink: 0,
31
+ pt: 8,
32
+ width: 32
33
+ },
34
+ children: /* @__PURE__ */ o(h, {
35
+ "aria-hidden": !0,
36
+ fill: !0,
37
+ name: i === "success" ? "check_circle" : "error",
38
+ size: 24
39
+ })
40
+ }), /* @__PURE__ */ c(t, {
41
+ sx: {
42
+ alignItems: "flex-start",
43
+ gap: 12,
44
+ pl: 4,
45
+ py: 8
46
+ },
47
+ children: [/* @__PURE__ */ o(a, {
48
+ sx: { color: "inherit" },
49
+ variant: "subtitle1",
50
+ children: m
51
+ }), n && /* @__PURE__ */ o(d, {
52
+ disabled: n.pending,
53
+ onClick: n.onPress,
54
+ sx: {
55
+ color: "inherit",
56
+ height: "auto",
57
+ lineHeight: "20px",
58
+ minHeight: 0,
59
+ p: 0
60
+ },
61
+ variant: "text",
62
+ children: n.label
63
+ })]
64
+ })]
65
+ })
66
+ });
67
+ export {
68
+ k as SurveyResult
69
+ };
70
+
71
+ //# sourceMappingURL=SurveyResult.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SurveyResult.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/FeedbackBlock/SurveyResult.tsx"],"sourcesContent":["import type { RefObject } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\n\ninterface SurveyResultProps {\n bannerRef: RefObject<HTMLDivElement | null>\n message: string\n severity: 'success' | 'error'\n /** The error's retry, under the message; disabled while `pending`. */\n retry?: { label: string; pending: boolean; onPress: () => void }\n}\n\n/**\n * The survey's result, in place of its steps: Figma's <Snackbar> banner. Light mode draws white on\n * the 600 tone; dark mode the main tone, where white fails AA, so black. The icon takes the same colour.\n */\nexport const SurveyResult = ({ bannerRef, message, severity, retry }: SurveyResultProps) => (\n <Box sx={{ pb: 16, px: 16, width: '100%' }}>\n <Stack\n direction=\"row\"\n ref={bannerRef}\n role={severity === 'error' ? 'alert' : 'status'}\n sx={({ palette }) => {\n const dark = palette.mode === 'dark'\n return {\n bgcolor: dark ? palette[severity].main : palette[severity][600],\n borderRadius: 1,\n color: dark ? palette.common.black : palette.common.white,\n px: 16,\n py: 8,\n }\n }}\n tabIndex={-1}\n >\n <Box sx={{ flexShrink: 0, pt: 8, width: 32 }}>\n <Icon\n aria-hidden={true}\n fill={true}\n name={severity === 'success' ? 'check_circle' : 'error'}\n size={24}\n />\n </Box>\n <Stack sx={{ alignItems: 'flex-start', gap: 12, pl: 4, py: 8 }}>\n <Text sx={{ color: 'inherit' }} variant=\"subtitle1\">\n {message}\n </Text>\n {retry && (\n <Button\n disabled={retry.pending}\n onClick={retry.onPress}\n // A text action (Figma body1 semibold 15/20), not mxui's 44px button; alone in the\n // banner, so its 20px target meets WCAG 2.5.8's spacing exception.\n sx={{ color: 'inherit', height: 'auto', lineHeight: '20px', minHeight: 0, p: 0 }}\n variant=\"text\"\n >\n {retry.label}\n </Button>\n )}\n </Stack>\n </Stack>\n </Box>\n)\n"],"mappings":";;;;;;AAqBA,IAAa,IAAA,CAAgB,EAAE,WAAA,GAAW,SAAA,GAAS,UAAA,GAAU,OAAA,EAAA,MAC3D,gBAAA,EAAC,GAAD;AAAA,EAAK,IAAI;AAAA,IAAE,IAAI;AAAA,IAAI,IAAI;AAAA,IAAI,OAAO;AAAA,EAAO;AAAA,EACvC,UAAA,gBAAA,EAAC,GAAD;AAAA,IACE,WAAU;AAAA,IACV,KAAK;AAAA,IACL,MAAM,MAAa,UAAU,UAAU;AAAA,IACvC,IAAA,CAAK,EAAE,SAAA,EAAA,MAAc;AACnB,YAAM,IAAO,EAAQ,SAAS;AAC9B,aAAO;AAAA,QACL,SAAS,IAAO,EAAQ,CAAA,EAAU,OAAO,EAAQ,CAAA,EAAU,GAAA;AAAA,QAC3D,cAAc;AAAA,QACd,OAAO,IAAO,EAAQ,OAAO,QAAQ,EAAQ,OAAO;AAAA,QACpD,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,UAAU;AAAA,IAdZ,UAAA,CAgBE,gBAAA,EAAC,GAAD;AAAA,MAAK,IAAI;AAAA,QAAE,YAAY;AAAA,QAAG,IAAI;AAAA,QAAG,OAAO;AAAA,MAAG;AAAA,MACzC,UAAA,gBAAA,EAAC,GAAD;AAAA,QACE,eAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM,MAAa,YAAY,iBAAiB;AAAA,QAChD,MAAM;AAAA,MACP,CAAA;AAAA,IACE,CAAA,GACL,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI;AAAA,QAAE,YAAY;AAAA,QAAc,KAAK;AAAA,QAAI,IAAI;AAAA,QAAG,IAAI;AAAA,MAAE;AAAA,MAA7D,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,QAAM,IAAI,EAAE,OAAO,UAAU;AAAA,QAAG,SAAQ;AAAA,QACrC,UAAA;AAAA,MACG,CAAA,GACL,KACC,gBAAA,EAAC,GAAD;AAAA,QACE,UAAU,EAAM;AAAA,QAChB,SAAS,EAAM;AAAA,QAGf,IAAI;AAAA,UAAE,OAAO;AAAA,UAAW,QAAQ;AAAA,UAAQ,YAAY;AAAA,UAAQ,WAAW;AAAA,UAAG,GAAG;AAAA,QAAE;AAAA,QAC/E,SAAQ;AAAA,QAEP,UAAA,EAAM;AAAA,MACD,CAAA,CAEL;AAAA,IACF,CAAA,CAAA;AAAA;AACJ,CAAA"}
@@ -1,12 +1,57 @@
1
- /** pulse's USER_FEEDBACK_INSIGHT_SURVEY_ID: the same PostHog survey, per environment. */
2
- export declare const userFeedbackSurveyId: (postHogPublicKey?: string) => "01986709-032e-0000-5496-ad8f17623225" | "0198428e-bfe6-0000-002d-1fe2e87b3821";
3
- /** The PostHog survey events pulse's UserFeedback beat sends, with the same keys. */
4
- export declare const userFeedbackSurveyEvents: (postHogPublicKey?: string) => {
1
+ import { Beat } from '../../../../core';
2
+ import { GlobalStore } from '../../../../core/stores/GlobalStore';
3
+ import { InstanceSlotData } from '../../../../core/types/Insights';
4
+ import { BeatActions } from '../../../beatActions';
5
+ /** The PostHog surveys a beat can name (`survey_key`), per environment: the frontend owns the ids. */
6
+ export declare const POSTHOG_SURVEYS: {
7
+ readonly user_feedback: {
8
+ readonly production: "01986709-032e-0000-5496-ad8f17623225";
9
+ readonly development: "0198428e-bfe6-0000-002d-1fe2e87b3821";
10
+ };
11
+ };
12
+ export type SurveyKey = keyof typeof POSTHOG_SURVEYS;
13
+ export interface RatingStep {
14
+ type: 'rating';
15
+ question: string;
16
+ min_label: string;
17
+ max_label: string;
18
+ }
19
+ export interface TextStep {
20
+ type: 'text';
21
+ question: string;
22
+ label: string;
23
+ placeholder: string;
24
+ }
25
+ export type SurveyStep = RatingStep | TextStep;
26
+ /**
27
+ * The survey a beat sends in `feedback_block`'s `instance_slot.data`: the PostHog survey it names, its
28
+ * steps (a 1-5 rating or a free-text answer each, one per screen) and the words around them. The
29
+ * card's primary CTA moves through the steps (`answer_feedback_survey`), so any beat can reuse it.
30
+ */
31
+ export interface Survey {
32
+ survey_key: SurveyKey;
33
+ steps: SurveyStep[];
34
+ submit_label: string;
35
+ success_title: string;
36
+ success_message: string;
37
+ error_title: string;
38
+ error_message: string;
39
+ retry_label: string;
40
+ /** `_1{rating}`: a scale button's accessible name. */
41
+ rating_aria: string;
42
+ /** `_1{step} of _2{total}`: the progress for screen readers (the step bar is decorative). */
43
+ step_count: string;
44
+ }
45
+ /** The whole survey (a known `survey_key`, every word non-blank), else undefined: the block draws nothing. */
46
+ export declare const readSurvey: (data?: InstanceSlotData) => Survey | undefined;
47
+ export declare const surveyOf: (beat: Beat) => Survey | undefined;
48
+ /** The PostHog survey events, for the environment's survey; one `$survey_response` per step. */
49
+ export declare const surveyEvents: (survey: Survey, postHogPublicKey?: string) => {
5
50
  shown: {
6
51
  postHog: {
7
52
  eventName: string;
8
53
  properties: () => {
9
- $survey_id: string;
54
+ $survey_id: "01986709-032e-0000-5496-ad8f17623225" | "0198428e-bfe6-0000-002d-1fe2e87b3821";
10
55
  };
11
56
  };
12
57
  };
@@ -14,16 +59,45 @@ export declare const userFeedbackSurveyEvents: (postHogPublicKey?: string) => {
14
59
  postHog: {
15
60
  eventName: string;
16
61
  properties: () => {
17
- $survey_id: string;
62
+ $survey_id: "01986709-032e-0000-5496-ad8f17623225" | "0198428e-bfe6-0000-002d-1fe2e87b3821";
18
63
  };
19
64
  };
20
65
  };
21
- sent: (first?: number, second?: number, feedback?: string) => {
66
+ sent: (answers: SurveyAnswer[]) => {
22
67
  postHog: {
23
68
  eventName: string;
24
69
  properties: () => {
25
- $survey_id: string;
70
+ $survey_id: "01986709-032e-0000-5496-ad8f17623225" | "0198428e-bfe6-0000-002d-1fe2e87b3821";
26
71
  };
27
72
  };
28
73
  };
29
74
  };
75
+ /** beatContext keys: the answers, the step and the result live per beat, read by the block and the CTA. */
76
+ export declare const SURVEY_CONTEXT: {
77
+ readonly STEP: "survey_step";
78
+ readonly ANSWERS: "survey_answers";
79
+ readonly PHASE: "survey_phase";
80
+ readonly SHOWN: "survey_shown";
81
+ };
82
+ /** A free-text answer's limit, on the field and on the sent payload. */
83
+ export declare const TEXT_MAX_LENGTH = 500;
84
+ export type SurveyAnswer = number | string | undefined;
85
+ export type SurveyPhase = 'sent' | 'error';
86
+ export interface SurveyState {
87
+ step: number;
88
+ answers: SurveyAnswer[];
89
+ phase?: SurveyPhase;
90
+ }
91
+ /** The saved progress, its step kept within the survey's steps. */
92
+ export declare const surveyState: (context?: Record<string, unknown>, steps?: number) => SurveyState;
93
+ /**
94
+ * Dismisses the beat but keeps its card, with the result, until the feed refreshes; records the
95
+ * result either way. On a failure the keep flag stays for the block to clear while the beat is live:
96
+ * only it sees whether the host flipped is_dismissed first. Submit and Try Again both use it, so a
97
+ * retry never re-sends the answers.
98
+ */
99
+ export declare const dismissSurveyBeat: ({ beatGuid, stores, onCtaAction, }: {
100
+ beatGuid: string;
101
+ stores: GlobalStore;
102
+ onCtaAction?: BeatActions["onCtaAction"];
103
+ }) => Promise<void>;
@@ -1,25 +1,76 @@
1
- import { isProductionPostHogKey as u } from "../../../../core/utils/PostHog.es.js";
2
- var v = (e) => u(e) ? "01986709-032e-0000-5496-ad8f17623225" : "0198428e-bfe6-0000-002d-1fe2e87b3821", y = (e) => {
3
- const n = v(e), s = (r, o = {}) => ({ postHog: {
4
- eventName: r,
1
+ import { isProductionPostHogKey as _ } from "../../../../core/utils/PostHog.es.js";
2
+ import { BEAT_KEEP_AFTER_DISMISS_KEY as p } from "../../../../core/stores/InsightsV2Store.es.js";
3
+ import { asNonEmptyText as S } from "../../slotReaders.es.js";
4
+ import { HOST_ACTIONS as m } from "../../../ctaActions/hostActions.es.js";
5
+ var y = { user_feedback: {
6
+ production: "01986709-032e-0000-5496-ad8f17623225",
7
+ development: "0198428e-bfe6-0000-002d-1fe2e87b3821"
8
+ } }, c = (e) => typeof e == "string" && Object.hasOwn(y, e), l = [
9
+ "submit_label",
10
+ "success_title",
11
+ "success_message",
12
+ "error_title",
13
+ "error_message",
14
+ "retry_label",
15
+ "rating_aria",
16
+ "step_count"
17
+ ], E = {
18
+ rating: ["min_label", "max_label"],
19
+ text: ["label", "placeholder"]
20
+ }, u = (e, r) => r.every((s) => S(e[s]) !== void 0), d = (e) => {
21
+ if (typeof e != "object" || e === null) return !1;
22
+ const { type: r } = e;
23
+ return (r === "rating" || r === "text") && u(e, ["question", ...E[r]]);
24
+ }, f = (e) => {
25
+ if (!e) return;
26
+ const { steps: r, survey_key: s } = e;
27
+ return c(s) && Array.isArray(r) && r.length > 0 && r.every(d) && u(e, l) ? e : void 0;
28
+ }, w = (e) => f(e.insights_payload?.instance_slot?.data), P = (e, r) => {
29
+ const s = y[e.survey_key], o = _(r) ? s.production : s.development, t = (a, i = {}) => ({ postHog: {
30
+ eventName: a,
5
31
  properties: () => ({
6
- $survey_id: n,
7
- ...o
32
+ $survey_id: o,
33
+ ...i
8
34
  })
9
35
  } });
10
36
  return {
11
- shown: s("survey shown"),
12
- dismissed: s("survey dismissed"),
13
- sent: (r, o, t) => s("survey sent", {
14
- $survey_response: r,
15
- $survey_response_1: o,
16
- $survey_response_2: t
17
- })
37
+ shown: t("survey shown"),
38
+ dismissed: t("survey dismissed"),
39
+ sent: (a) => t("survey sent", Object.fromEntries(a.map((i, v) => [v === 0 ? "$survey_response" : `$survey_response_${v}`, i])))
40
+ };
41
+ }, n = {
42
+ STEP: "survey_step",
43
+ ANSWERS: "survey_answers",
44
+ PHASE: "survey_phase",
45
+ SHOWN: "survey_shown"
46
+ }, T = (e = {}, r = 1) => {
47
+ const s = e[n.STEP], o = e[n.ANSWERS], t = e[n.PHASE];
48
+ return {
49
+ step: typeof s == "number" ? Math.min(Math.max(s, 0), r - 1) : 0,
50
+ answers: Array.isArray(o) ? o : [],
51
+ phase: t === "sent" || t === "error" ? t : void 0
18
52
  };
53
+ }, b = async ({ beatGuid: e, stores: r, onCtaAction: s }) => {
54
+ const { setBeatContext: o } = r.insightsV2Store;
55
+ o(e, { [p]: !0 });
56
+ try {
57
+ if (!s) throw new Error("Host does not implement onCtaAction");
58
+ await s({
59
+ beatGuid: e,
60
+ name: m.dismissBeat
61
+ }), o(e, { [n.PHASE]: "sent" });
62
+ } catch (t) {
63
+ throw o(e, { [n.PHASE]: "error" }), t;
64
+ }
19
65
  };
20
66
  export {
21
- y as userFeedbackSurveyEvents,
22
- v as userFeedbackSurveyId
67
+ y as POSTHOG_SURVEYS,
68
+ n as SURVEY_CONTEXT,
69
+ b as dismissSurveyBeat,
70
+ f as readSurvey,
71
+ P as surveyEvents,
72
+ w as surveyOf,
73
+ T as surveyState
23
74
  };
24
75
 
25
76
  //# sourceMappingURL=survey.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"survey.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.ts"],"sourcesContent":["import { isProductionPostHogKey } from '../../../../core/utils/PostHog'\nimport type { AnalyticsEventConfigEntry } from '../../../analytics/analyticsEventsConfig'\n\n/** pulse's USER_FEEDBACK_INSIGHT_SURVEY_ID: the same PostHog survey, per environment. */\nexport const userFeedbackSurveyId = (postHogPublicKey?: string) =>\n isProductionPostHogKey(postHogPublicKey)\n ? '01986709-032e-0000-5496-ad8f17623225'\n : '0198428e-bfe6-0000-002d-1fe2e87b3821'\n\n/** The PostHog survey events pulse's UserFeedback beat sends, with the same keys. */\nexport const userFeedbackSurveyEvents = (postHogPublicKey?: string) => {\n const $survey_id = userFeedbackSurveyId(postHogPublicKey)\n const event = (eventName: string, extra: Record<string, unknown> = {}) =>\n ({\n postHog: { eventName, properties: () => ({ $survey_id, ...extra }) },\n }) satisfies AnalyticsEventConfigEntry\n\n return {\n shown: event('survey shown'),\n dismissed: event('survey dismissed'),\n sent: (first?: number, second?: number, feedback?: string) =>\n event('survey sent', {\n $survey_response: first,\n $survey_response_1: second,\n $survey_response_2: feedback,\n }),\n }\n}\n"],"mappings":";AAIA,IAAa,IAAA,CAAwB,MACnC,EAAuB,CAAgB,IACnC,yCACA,wCAGO,IAAA,CAA4B,MAA8B;AACrE,QAAM,IAAa,EAAqB,CAAgB,GAClD,IAAA,CAAS,GAAmB,IAAiC,CAAC,OACjE,EACC,SAAS;AAAA,IAAE,WAAA;AAAA,IAAW,YAAA,OAAmB;AAAA,MAAE,YAAA;AAAA,MAAY,GAAG;AAAA,IAAM;AAAA,EAAG,EACrE;AAEF,SAAO;AAAA,IACL,OAAO,EAAM,cAAc;AAAA,IAC3B,WAAW,EAAM,kBAAkB;AAAA,IACnC,MAAA,CAAO,GAAgB,GAAiB,MACtC,EAAM,eAAe;AAAA,MACnB,kBAAkB;AAAA,MAClB,oBAAoB;AAAA,MACpB,oBAAoB;AAAA,IACtB,CAAC;AAAA,EACL;AACF"}
1
+ {"version":3,"file":"survey.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.ts"],"sourcesContent":["import type { Beat } from '../../../../core'\nimport type { GlobalStore } from '../../../../core/stores/GlobalStore'\nimport { BEAT_KEEP_AFTER_DISMISS_KEY } from '../../../../core/stores/InsightsV2Store'\nimport type { InstanceSlotData } from '../../../../core/types/Insights'\nimport { isProductionPostHogKey } from '../../../../core/utils/PostHog'\nimport type { AnalyticsEventConfigEntry } from '../../../analytics/analyticsEventsConfig'\nimport type { BeatActions } from '../../../beatActions'\nimport { HOST_ACTIONS } from '../../../ctaActions/hostActions'\nimport { asNonEmptyText } from '../../slotReaders'\n\n/** The PostHog surveys a beat can name (`survey_key`), per environment: the frontend owns the ids. */\nexport const POSTHOG_SURVEYS = {\n // pulse's USER_FEEDBACK_INSIGHT_SURVEY_ID.\n user_feedback: {\n production: '01986709-032e-0000-5496-ad8f17623225',\n development: '0198428e-bfe6-0000-002d-1fe2e87b3821',\n },\n} as const\n\nexport type SurveyKey = keyof typeof POSTHOG_SURVEYS\n\nconst isSurveyKey = (key: unknown): key is SurveyKey =>\n typeof key === 'string' && Object.hasOwn(POSTHOG_SURVEYS, key)\n\nexport interface RatingStep {\n type: 'rating'\n question: string\n min_label: string\n max_label: string\n}\n\nexport interface TextStep {\n type: 'text'\n question: string\n label: string\n placeholder: string\n}\n\nexport type SurveyStep = RatingStep | TextStep\n\n/**\n * The survey a beat sends in `feedback_block`'s `instance_slot.data`: the PostHog survey it names, its\n * steps (a 1-5 rating or a free-text answer each, one per screen) and the words around them. The\n * card's primary CTA moves through the steps (`answer_feedback_survey`), so any beat can reuse it.\n */\nexport interface Survey {\n survey_key: SurveyKey\n steps: SurveyStep[]\n submit_label: string\n success_title: string\n success_message: string\n error_title: string\n error_message: string\n retry_label: string\n /** `_1{rating}`: a scale button's accessible name. */\n rating_aria: string\n /** `_1{step} of _2{total}`: the progress for screen readers (the step bar is decorative). */\n step_count: string\n}\n\nconst REQUIRED_WORDS = [\n 'submit_label',\n 'success_title',\n 'success_message',\n 'error_title',\n 'error_message',\n 'retry_label',\n 'rating_aria',\n 'step_count',\n] as const\n\nconst STEP_WORDS = { rating: ['min_label', 'max_label'], text: ['label', 'placeholder'] } as const\n\nconst hasNonBlank = (record: object, keys: readonly string[]) =>\n keys.every((key) => asNonEmptyText((record as Record<string, unknown>)[key]) !== undefined)\n\nconst isStep = (step: unknown): step is SurveyStep => {\n if (typeof step !== 'object' || step === null) return false\n const { type } = step as { type?: unknown }\n\n return (\n (type === 'rating' || type === 'text') && hasNonBlank(step, ['question', ...STEP_WORDS[type]])\n )\n}\n\n/** The whole survey (a known `survey_key`, every word non-blank), else undefined: the block draws nothing. */\nexport const readSurvey = (data?: InstanceSlotData): Survey | undefined => {\n if (!data) return undefined\n const { steps, survey_key } = data as Partial<Survey>\n const valid =\n isSurveyKey(survey_key) &&\n Array.isArray(steps) &&\n steps.length > 0 &&\n steps.every(isStep) &&\n hasNonBlank(data, REQUIRED_WORDS)\n\n return valid ? (data as unknown as Survey) : undefined\n}\n\nexport const surveyOf = (beat: Beat) => readSurvey(beat.insights_payload?.instance_slot?.data)\n\n/** The PostHog survey events, for the environment's survey; one `$survey_response` per step. */\nexport const surveyEvents = (survey: Survey, postHogPublicKey?: string) => {\n const ids = POSTHOG_SURVEYS[survey.survey_key]\n const $survey_id = isProductionPostHogKey(postHogPublicKey) ? ids.production : ids.development\n const event = (eventName: string, extra: Record<string, unknown> = {}) =>\n ({\n postHog: { eventName, properties: () => ({ $survey_id, ...extra }) },\n }) satisfies AnalyticsEventConfigEntry\n\n return {\n shown: event('survey shown'),\n dismissed: event('survey dismissed'),\n sent: (answers: SurveyAnswer[]) =>\n event(\n 'survey sent',\n Object.fromEntries(\n answers.map((answer, index) => [\n index === 0 ? '$survey_response' : `$survey_response_${index}`,\n answer,\n ]),\n ),\n ),\n }\n}\n\n/** beatContext keys: the answers, the step and the result live per beat, read by the block and the CTA. */\nexport const SURVEY_CONTEXT = {\n STEP: 'survey_step',\n ANSWERS: 'survey_answers',\n PHASE: 'survey_phase',\n // The shown event already fired for this beat (survives a remount after Undo).\n SHOWN: 'survey_shown',\n} as const\n\n/** A free-text answer's limit, on the field and on the sent payload. */\nexport const TEXT_MAX_LENGTH = 500\n\nexport type SurveyAnswer = number | string | undefined\nexport type SurveyPhase = 'sent' | 'error'\n\nexport interface SurveyState {\n step: number\n answers: SurveyAnswer[]\n phase?: SurveyPhase\n}\n\n/** The saved progress, its step kept within the survey's steps. */\nexport const surveyState = (context: Record<string, unknown> = {}, steps = 1): SurveyState => {\n const step = context[SURVEY_CONTEXT.STEP]\n const answers = context[SURVEY_CONTEXT.ANSWERS]\n const phase = context[SURVEY_CONTEXT.PHASE]\n\n return {\n step: typeof step === 'number' ? Math.min(Math.max(step, 0), steps - 1) : 0,\n answers: Array.isArray(answers) ? answers : [],\n phase: phase === 'sent' || phase === 'error' ? phase : undefined,\n }\n}\n\n/**\n * Dismisses the beat but keeps its card, with the result, until the feed refreshes; records the\n * result either way. On a failure the keep flag stays for the block to clear while the beat is live:\n * only it sees whether the host flipped is_dismissed first. Submit and Try Again both use it, so a\n * retry never re-sends the answers.\n */\nexport const dismissSurveyBeat = async ({\n beatGuid,\n stores,\n onCtaAction,\n}: {\n beatGuid: string\n stores: GlobalStore\n onCtaAction?: BeatActions['onCtaAction']\n}) => {\n const { setBeatContext } = stores.insightsV2Store\n setBeatContext(beatGuid, { [BEAT_KEEP_AFTER_DISMISS_KEY]: true })\n\n try {\n if (!onCtaAction) throw new Error('Host does not implement onCtaAction')\n await onCtaAction({ beatGuid, name: HOST_ACTIONS.dismissBeat })\n setBeatContext(beatGuid, { [SURVEY_CONTEXT.PHASE]: 'sent' })\n } catch (error) {\n setBeatContext(beatGuid, { [SURVEY_CONTEXT.PHASE]: 'error' })\n throw error\n }\n}\n"],"mappings":";;;;AAWA,IAAa,IAAkB,EAE7B,eAAe;AAAA,EACb,YAAY;AAAA,EACZ,aAAa;AACf,EACF,GAIM,IAAA,CAAe,MACnB,OAAO,KAAQ,YAAY,OAAO,OAAO,GAAiB,CAAG,GAsCzD,IAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEM,IAAa;AAAA,EAAE,QAAQ,CAAC,aAAa,WAAW;AAAA,EAAG,MAAM,CAAC,SAAS,aAAa;AAAE,GAElF,IAAA,CAAe,GAAgB,MACnC,EAAK,MAAA,CAAO,MAAQ,EAAgB,EAAmC,CAAA,CAAI,MAAM,MAAS,GAEtF,IAAA,CAAU,MAAsC;AACpD,MAAI,OAAO,KAAS,YAAY,MAAS,KAAM,QAAO;AACtD,QAAM,EAAE,MAAA,EAAA,IAAS;AAEjB,UACG,MAAS,YAAY,MAAS,WAAW,EAAY,GAAM,CAAC,YAAY,GAAG,EAAW,CAAA,CAAK,CAAC;AAEjG,GAGa,IAAA,CAAc,MAAgD;AACzE,MAAI,CAAC,EAAM;A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A,EACzD;AACF,GAQa,IAAoB,OAAO,EACtC,UAAA,GACA,QAAA,GACA,aAAA,EAAA,MAKI;AACJ,QAAM,EAAE,gBAAA,EAAA,IAAmB,EAAO;AAClC,EAAA,EAAe,GAAU,EAAA,CAAG,CAAA,GAA8B,GAAK,CAAC;AAEhE,MAAI;AACF,QAAI,CAAC,EAAa,OAAM,IAAI,MAAM,qCAAqC;AACvE,UAAM,EAAY;AAAA,MAAE,UAAA;AAAA,MAAU,MAAM,EAAa;AAAA,IAAY,CAAC,GAC9D,EAAe,GAAU,EAAA,CAAG,EAAe,KAAA,GAAQ,OAAO,CAAC;AAAA,EAC7D,SAAS,GAAO;AACd,UAAA,EAAe,GAAU,EAAA,CAAG,EAAe,KAAA,GAAQ,QAAQ,CAAC,GACtD;AAAA,EACR;AACF"}
@@ -1,40 +1,35 @@
1
- import { slot as n } from "../../../../core/types/Insights.es.js";
2
- import { CURRENCY_FORMAT as R, formatCurrency as y } from "../../../../core/utils/NumberFormatting.es.js";
3
- import P from "../../../components/StatusPill.es.js";
4
- import { resolveVariantConfig as z } from "../../resolveVariantConfig.es.js";
5
- import { asLogoRef as B, asNumber as E, asText as i, slotOrFlat as g } from "../../slotReaders.es.js";
6
- import C, { isLogoGuid as M } from "../../../components/LogoFromGuid.es.js";
7
- import N from "../../../components/LogoClusterCard.es.js";
8
- import T from "../../../components/MerchantHighlightCard.es.js";
9
- import V from "../../../components/P2PLogoStack.es.js";
10
- import { MERCHANT_LAYOUT as w, merchantBlockVariant as D } from "./layout.es.js";
11
- import G from "@mui/material/Stack";
12
- import { Icon as L } from "@mxenabled/mx-icons";
1
+ import { slot as i } from "../../../../core/types/Insights.es.js";
2
+ import { CURRENCY_FORMAT as x, formatCurrency as L } from "../../../../core/utils/NumberFormatting.es.js";
3
+ import S from "../../../components/StatusPill.es.js";
4
+ import { resolveVariantConfig as y } from "../../resolveVariantConfig.es.js";
5
+ import { asLogoRef as O, asNumber as z, asText as n, slotOrFlat as c } from "../../slotReaders.es.js";
6
+ import v, { isLogoGuid as A } from "../../../components/LogoFromGuid.es.js";
7
+ import B from "../../../components/MerchantHighlightCard.es.js";
8
+ import M from "../../../components/P2PLogoStack.es.js";
9
+ import { MERCHANT_LAYOUT as P, merchantBlockVariant as R } from "./layout.es.js";
10
+ import V from "@mui/material/Stack";
11
+ import { Icon as b } from "@mxenabled/mx-icons";
13
12
  import { jsx as e } from "react/jsx-runtime";
14
- var u = 72, b = 6, F = 3, I = 10, K = [
15
- 0,
16
- 10,
17
- 25
18
- ], j = (a) => a === 2 || a === 3 || a === 4, H = 32, m = (a) => {
19
- const r = B(a);
20
- return r?.guid && M(r.guid) ? r : void 0;
21
- }, U = (a) => {
13
+ var p = 72, w = 6, T = 32, d = (a) => {
14
+ const r = O(a);
15
+ return r?.guid && A(r.guid) ? r : void 0;
16
+ }, E = (a) => {
22
17
  if (!Array.isArray(a)) return [];
23
18
  const r = /* @__PURE__ */ new Map();
24
- for (const t of a.map(m)) t?.guid && !r.has(t.guid) && r.set(t.guid, t);
19
+ for (const t of a.map(d)) t?.guid && !r.has(t.guid) && r.set(t.guid, t);
25
20
  return [...r.values()];
26
- }, O = /* @__PURE__ */ e(L, {
21
+ }, _ = /* @__PURE__ */ e(b, {
27
22
  "aria-hidden": !0,
28
23
  "data-icon": "storefront",
29
24
  name: "storefront",
30
- size: H,
25
+ size: T,
31
26
  sx: { color: "text.secondary" }
32
- }), _ = (a, r) => a.length ? a.map((t) => /* @__PURE__ */ e(C, {
27
+ }), G = (a, r) => a.length ? a.map((t) => /* @__PURE__ */ e(v, {
33
28
  logo: t,
34
29
  size: r
35
- }, t.guid)) : [O], no = ({ payload: a }) => {
36
- const { instance_slot: r } = a, { data: t } = r, o = z(w, r.variant, D.SingleStandard, "MerchantBlock"), f = i(g(r, "status_text")), h = o.status && f ? /* @__PURE__ */ e(P, {
37
- icon: /* @__PURE__ */ e(L, {
30
+ }, t.guid)) : [_], Q = ({ payload: a }) => {
31
+ const { instance_slot: r } = a, { data: t } = r, o = y(P, r.variant, R.SingleStandard, "MerchantBlock"), g = n(c(r, "status_text")), u = o.status && g ? /* @__PURE__ */ e(S, {
32
+ icon: /* @__PURE__ */ e(b, {
38
33
  "aria-hidden": !0,
39
34
  "data-icon": "check_circle",
40
35
  fill: !0,
@@ -42,76 +37,64 @@ var u = 72, b = 6, F = 3, I = 10, K = [
42
37
  size: 16,
43
38
  sx: { color: "success.700" }
44
39
  }),
45
- label: f,
40
+ label: g,
46
41
  sx: o.kind === "single" ? void 0 : {
47
42
  alignSelf: "stretch",
48
43
  justifyContent: "center"
49
44
  }
50
45
  }) : void 0;
51
46
  if (o.kind !== "single") {
52
- const c = U(n(t, "logos"));
53
- if (o.kind === "ranked" && c.length) {
54
- const d = c.slice(0, F), A = j(d.length) && o.cascade?.offsets?.[d.length] || K;
55
- return /* @__PURE__ */ e(N, {
56
- background: o.background,
57
- fullBleed: !0,
58
- logos: _(d, u),
59
- overlap: o.cascade?.overlap ?? b,
60
- rankOffsets: A.map((S) => I + S),
61
- ranked: !0
62
- });
63
- }
64
- const k = o.logo?.size ?? u;
65
- return /* @__PURE__ */ e(G, {
47
+ const C = E(i(t, "logos")), h = o.logo?.size ?? p;
48
+ return /* @__PURE__ */ e(V, {
66
49
  sx: {
67
50
  background: o.background,
68
51
  bgcolor: o.background ? void 0 : o.bgcolor,
69
52
  p: 16,
70
53
  width: "100%"
71
54
  },
72
- children: /* @__PURE__ */ e(V, {
55
+ children: /* @__PURE__ */ e(M, {
73
56
  borderColor: o.logo?.borderColor ?? null,
74
- logos: _(c, k),
57
+ logos: G(C, h),
75
58
  offsets: o.cascade?.offsets,
76
- overlap: o.cascade?.overlap ?? b,
59
+ overlap: o.cascade?.overlap ?? w,
77
60
  shadow: "elevation",
78
- size: k,
79
- status: h
61
+ size: h,
62
+ status: u
80
63
  })
81
64
  });
82
65
  }
83
- const s = i(n(t, "primary_text")) || i(g(r, "merchant_name"));
84
- if (!s) return null;
85
- const l = E(g(r, "amount")), x = i(n(t, "header_text")) || i(n(t, "date")), p = m(n(t, "logo")) ?? m({
86
- alt: s,
66
+ const l = n(i(t, "primary_text")) || n(c(r, "merchant_name"));
67
+ if (!l) return null;
68
+ const s = z(c(r, "amount")), k = n(i(t, "header_text")) || n(i(t, "date")), m = d(i(t, "logo")) ?? d({
69
+ alt: l,
87
70
  fallback_guid: r.category_guid,
88
71
  guid: r.merchant_guid
89
- }), v = o.logo?.size ?? u;
90
- return /* @__PURE__ */ e(T, {
91
- amount: l !== void 0 && l !== 0 ? y(l, R.cents) : void 0,
72
+ }), f = o.logo?.size ?? p;
73
+ return /* @__PURE__ */ e(B, {
74
+ amount: s !== void 0 && s !== 0 ? L(s, x.cents) : void 0,
92
75
  amountPill: o.amountPill,
93
76
  amountVariant: o.amountVariant,
94
77
  background: o.background,
95
78
  bgcolor: o.bgcolor,
96
79
  borderColor: o.borderColor,
97
- eyebrow: o.hideDate ? void 0 : x,
80
+ eyebrow: o.hideDate ? void 0 : k,
98
81
  fullBleed: o.fullBleed,
99
82
  gap: o.gap,
100
- logo: p ? /* @__PURE__ */ e(C, {
101
- logo: p,
102
- size: v
103
- }) : O,
83
+ logo: m ? /* @__PURE__ */ e(v, {
84
+ logo: m,
85
+ size: f
86
+ }) : _,
104
87
  logoBorderColor: o.logo?.borderColor,
105
88
  logoRadius: o.logo?.radius,
106
89
  logoShadow: o.logo?.shadow,
107
- logoSize: v,
108
- name: s,
90
+ logoSize: f,
91
+ name: l,
109
92
  nameVariant: o.nameVariant,
110
- trailing: h
93
+ trailing: u
111
94
  });
112
95
  };
113
96
  export {
114
- no as default
97
+ Q as default
115
98
  };
116
99
 
117
100
  //# sourceMappingURL=MerchantBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MerchantBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport type { MerchantBlockData } from '../../../../core/types/InsightsInstanceSlotData'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport LogoClusterCard from '../../../components/LogoClusterCard'\nimport LogoFromGuid, { isLogoGuid } from '../../../components/LogoFromGuid'\nimport MerchantHighlightCard from '../../../components/MerchantHighlightCard'\nimport P2PLogoStack, { type CascadeOffsets } from '../../../components/P2PLogoStack'\nimport StatusPill from '../../../components/StatusPill'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef, asNumber, asText, slotOrFlat } from '../../slotReaders'\n\nimport { MERCHANT_LAYOUT, merchantBlockVariant } from './layout'\n\ninterface MerchantBlockProps {\n payload: InsightsPayload\n}\n\nconst LOGO_SIZE = 72\nconst LOGO_OVERLAP = 6\nconst RANKED_MAX = 3\n// The ranked row's room above the first tile for its badge overhang the variant's drops start below it.\nconst RANKED_TOP = 10\n// Drops for a ranked variant that sets no `cascade.offsets` for its tile count.\nconst RANKED_DROPS = [0, 10, 25] as const\n// The tile counts `cascade.offsets` can name.\nconst hasCascadeOffsets = (count: number): count is keyof CascadeOffsets =>\n count === 2 || count === 3 || count === 4\nconst FALLBACK_ICON_SIZE = 32\n\n/** A logo ref naming a known logo guid, else undefined, so an unusable one falls through. */\nconst asMerchantLogo = (value: unknown): LogoRef | undefined => {\n const ref = asLogoRef(value)\n return ref?.guid && isLogoGuid(ref.guid) ? ref : undefined\n}\n\nconst uniqueLogos = (refs: unknown): LogoRef[] => {\n if (!Array.isArray(refs)) return []\n const byGuid = new Map<string, LogoRef>()\n for (const ref of refs.map(asMerchantLogo)) {\n if (ref?.guid && !byGuid.has(ref.guid)) byGuid.set(ref.guid, ref)\n }\n return [...byGuid.values()]\n}\n\nconst storefront = (\n <Icon\n aria-hidden={true}\n data-icon=\"storefront\"\n name=\"storefront\"\n size={FALLBACK_ICON_SIZE}\n sx={{ color: 'text.secondary' }}\n />\n)\n\nconst logoTiles = (refs: LogoRef[], size: number) =>\n refs.length\n ? refs.map((ref) => <LogoFromGuid key={ref.guid} logo={ref} size={size} />)\n : [storefront]\n\nconst MerchantBlock = ({ payload }: MerchantBlockProps) => {\n const { instance_slot } = payload\n const { data } = instance_slot\n const config = resolveVariantConfig(\n MERCHANT_LAYOUT,\n instance_slot.variant,\n merchantBlockVariant.SingleStandard,\n 'MerchantBlock',\n )\n const statusText = asText(slotOrFlat(instance_slot, 'status_text'))\n const statusPill =\n config.status && statusText ? (\n <StatusPill\n icon={\n <Icon\n aria-hidden={true}\n data-icon=\"check_circle\"\n fill={true}\n name=\"check_circle\"\n size={16}\n sx={{ color: 'success.700' }}\n />\n }\n label={statusText}\n sx={\n config.kind === 'single' ? undefined : { alignSelf: 'stretch', justifyContent: 'center' }\n }\n />\n ) : undefined\n\n if (config.kind !== 'single') {\n const logos = uniqueLogos(slot<MerchantBlockData['logos']>(data, 'logos'))\n\n if (config.kind === 'ranked' && logos.length) {\n const ranked = logos.slice(0, RANKED_MAX)\n const drops =\n (hasCascadeOffsets(ranked.length) && config.cascade?.offsets?.[ranked.length]) ||\n RANKED_DROPS\n\n return (\n <LogoClusterCard\n background={config.background}\n fullBleed={true}\n logos={logoTiles(ranked, LOGO_SIZE)}\n overlap={config.cascade?.overlap ?? LOGO_OVERLAP}\n rankOffsets={drops.map((drop) => RANKED_TOP + drop)}\n ranked={true}\n />\n )\n }\n\n const cascadeSize = config.logo?.size ?? LOGO_SIZE\n\n return (\n <Stack\n sx={{\n background: config.background,\n bgcolor: config.background ? undefined : config.bgcolor,\n p: 16,\n width: '100%',\n }}\n >\n <P2PLogoStack\n borderColor={config.logo?.borderColor ?? null}\n logos={logoTiles(logos, cascadeSize)}\n offsets={config.cascade?.offsets}\n overlap={config.cascade?.overlap ?? LOGO_OVERLAP}\n shadow=\"elevation\"\n size={cascadeSize}\n status={statusPill}\n />\n </Stack>\n )\n }\n\n // ditto's slot names first.\n const merchantName =\n asText(slot(data, 'primary_text')) || asText(slotOrFlat(instance_slot, 'merchant_name'))\n if (!merchantName) return null\n\n const amount = asNumber(slotOrFlat(instance_slot, 'amount'))\n const date = asText(slot(data, 'header_text')) || asText(slot(data, 'date'))\n const logo =\n asMerchantLogo(slot<unknown>(data, 'logo')) ??\n asMerchantLogo({\n alt: merchantName,\n fallback_guid: instance_slot.category_guid,\n guid: instance_slot.merchant_guid,\n })\n const logoSize = config.logo?.size ?? LOGO_SIZE\n\n return (\n <MerchantHighlightCard\n amount={\n amount !== undefined && amount !== 0\n ? formatCurrency(amount, CURRENCY_FORMAT.cents)\n : undefined\n }\n amountPill={config.amountPill}\n amountVariant={config.amountVariant}\n background={config.background}\n bgcolor={config.bgcolor}\n borderColor={config.borderColor}\n eyebrow={config.hideDate ? undefined : date}\n fullBleed={config.fullBleed}\n gap={config.gap}\n logo={logo ? <LogoFromGuid logo={logo} size={logoSize} /> : storefront}\n logoBorderColor={config.logo?.borderColor}\n logoRadius={config.logo?.radius}\n logoShadow={config.logo?.shadow}\n logoSize={logoSize}\n name={merchantName}\n nameVariant={config.nameVariant}\n trailing={statusPill}\n />\n )\n}\n\nexport default MerchantBlock\n"],"mappings":";;;;;;;;;;;;;AAsBA,IAAM,IAAY,IACZ,IAAe,GACf,IAAa,GAEb,IAAa,IAEb,IAAe;AAAA,EAAC;AAAA,EAAG;AAAA,EAAI;AAAE,GAEzB,IAAA,CAAqB,MACzB,MAAU,KAAK,MAAU,KAAK,MAAU,GACpC,IAAqB,IAGrB,IAAA,CAAkB,MAAwC;AAC9D,QAAM,IAAM,EAAU,CAAK;AAC3B,SAAO,GAAK,QAAQ,EAAW,EAAI,IAAI,IAAI,IAAM;AACnD,GAEM,IAAA,CAAe,MAA6B;AAChD,MAAI,CAAC,MAAM,QAAQ,CAAI,EAAG,QAAO,CAAC;AAClC,QAAM,IAAS,oBAAI,IAAqB;AACxC,aAAW,KAAO,EAAK,IAAI,CAAc,EACvC,CAAI,GAAK,QAAQ,CAAC,EAAO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A,IAEN,YAAY,EAAO;AAAA,IACnB,eAAe,EAAO;AAAA,IACtB,YAAY,EAAO;AAAA,IACnB,SAAS,EAAO;AAAA,IAChB,aAAa,EAAO;AAAA,IACpB,SAAS,EAAO,WAAW,SAAY;AAAA,IACvC,WAAW,EAAO;AAAA,IAClB,KAAK,EAAO;AAAA,IACZ,MAAM,IAAO,gBAAA,EAAC,GAAD;AAAA,MAAoB,MAAA;AAAA,MAAM,MAAM;AAAA,IAAW,CAAA,IAAI;AAAA,IAC5D,iBAAiB,EAAO,MAAM;AAAA,IAC9B,YAAY,EAAO,MAAM;AAAA,IACzB,YAAY,EAAO,MAAM;AAAA,IACf,UAAA;AAAA,IACV,MAAM;AAAA,IACN,aAAa,EAAO;AAAA,IACpB,UAAU;AAAA,EACX,CAAA;AAEL"}
1
+ {"version":3,"file":"MerchantBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport type { MerchantBlockData } from '../../../../core/types/InsightsInstanceSlotData'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport LogoFromGuid, { isLogoGuid } from '../../../components/LogoFromGuid'\nimport MerchantHighlightCard from '../../../components/MerchantHighlightCard'\nimport P2PLogoStack from '../../../components/P2PLogoStack'\nimport StatusPill from '../../../components/StatusPill'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef, asNumber, asText, slotOrFlat } from '../../slotReaders'\n\nimport { MERCHANT_LAYOUT, merchantBlockVariant } from './layout'\n\ninterface MerchantBlockProps {\n payload: InsightsPayload\n}\n\nconst LOGO_SIZE = 72\nconst LOGO_OVERLAP = 6\nconst FALLBACK_ICON_SIZE = 32\n\n/** A logo ref naming a known logo guid, else undefined, so an unusable one falls through. */\nconst asMerchantLogo = (value: unknown): LogoRef | undefined => {\n const ref = asLogoRef(value)\n return ref?.guid && isLogoGuid(ref.guid) ? ref : undefined\n}\n\nconst uniqueLogos = (refs: unknown): LogoRef[] => {\n if (!Array.isArray(refs)) return []\n const byGuid = new Map<string, LogoRef>()\n for (const ref of refs.map(asMerchantLogo)) {\n if (ref?.guid && !byGuid.has(ref.guid)) byGuid.set(ref.guid, ref)\n }\n return [...byGuid.values()]\n}\n\nconst storefront = (\n <Icon\n aria-hidden={true}\n data-icon=\"storefront\"\n name=\"storefront\"\n size={FALLBACK_ICON_SIZE}\n sx={{ color: 'text.secondary' }}\n />\n)\n\nconst logoTiles = (refs: LogoRef[], size: number) =>\n refs.length\n ? refs.map((ref) => <LogoFromGuid key={ref.guid} logo={ref} size={size} />)\n : [storefront]\n\nconst MerchantBlock = ({ payload }: MerchantBlockProps) => {\n const { instance_slot } = payload\n const { data } = instance_slot\n const config = resolveVariantConfig(\n MERCHANT_LAYOUT,\n instance_slot.variant,\n merchantBlockVariant.SingleStandard,\n 'MerchantBlock',\n )\n const statusText = asText(slotOrFlat(instance_slot, 'status_text'))\n const statusPill =\n config.status && statusText ? (\n <StatusPill\n icon={\n <Icon\n aria-hidden={true}\n data-icon=\"check_circle\"\n fill={true}\n name=\"check_circle\"\n size={16}\n sx={{ color: 'success.700' }}\n />\n }\n label={statusText}\n sx={\n config.kind === 'single' ? undefined : { alignSelf: 'stretch', justifyContent: 'center' }\n }\n />\n ) : undefined\n\n if (config.kind !== 'single') {\n const logos = uniqueLogos(slot<MerchantBlockData['logos']>(data, 'logos'))\n\n const cascadeSize = config.logo?.size ?? LOGO_SIZE\n\n return (\n <Stack\n sx={{\n background: config.background,\n bgcolor: config.background ? undefined : config.bgcolor,\n p: 16,\n width: '100%',\n }}\n >\n <P2PLogoStack\n borderColor={config.logo?.borderColor ?? null}\n logos={logoTiles(logos, cascadeSize)}\n offsets={config.cascade?.offsets}\n overlap={config.cascade?.overlap ?? LOGO_OVERLAP}\n shadow=\"elevation\"\n size={cascadeSize}\n status={statusPill}\n />\n </Stack>\n )\n }\n\n // ditto's slot names first.\n const merchantName =\n asText(slot(data, 'primary_text')) || asText(slotOrFlat(instance_slot, 'merchant_name'))\n if (!merchantName) return null\n\n const amount = asNumber(slotOrFlat(instance_slot, 'amount'))\n const date = asText(slot(data, 'header_text')) || asText(slot(data, 'date'))\n const logo =\n asMerchantLogo(slot<unknown>(data, 'logo')) ??\n asMerchantLogo({\n alt: merchantName,\n fallback_guid: instance_slot.category_guid,\n guid: instance_slot.merchant_guid,\n })\n const logoSize = config.logo?.size ?? LOGO_SIZE\n\n return (\n <MerchantHighlightCard\n amount={\n amount !== undefined && amount !== 0\n ? formatCurrency(amount, CURRENCY_FORMAT.cents)\n : undefined\n }\n amountPill={config.amountPill}\n amountVariant={config.amountVariant}\n background={config.background}\n bgcolor={config.bgcolor}\n borderColor={config.borderColor}\n eyebrow={config.hideDate ? undefined : date}\n fullBleed={config.fullBleed}\n gap={config.gap}\n logo={logo ? <LogoFromGuid logo={logo} size={logoSize} /> : storefront}\n logoBorderColor={config.logo?.borderColor}\n logoRadius={config.logo?.radius}\n logoShadow={config.logo?.shadow}\n logoSize={logoSize}\n name={merchantName}\n nameVariant={config.nameVariant}\n trailing={statusPill}\n />\n )\n}\n\nexport default MerchantBlock\n"],"mappings":";;;;;;;;;;;;AAqBA,IAAM,IAAY,IACZ,IAAe,GACf,IAAqB,IAGrB,IAAA,CAAkB,MAAwC;AAC9D,QAAM,IAAM,EAAU,CAAK;AAC3B,SAAO,GAAK,QAAQ,EAAW,EAAI,IAAI,IAAI,IAAM;AACnD,GAEM,IAAA,CAAe,MAA6B;AAChD,MAAI,CAAC,MAAM,QAAQ,CAAI,EAAG,QAAO,CAAC;AAClC,QAAM,IAAS,oBAAI,IAAqB;AACxC,aAAW,KAAO,EAAK,IAAI,CAAc,EACvC,CAAI,GAAK,QAAQ,CAAC,EAAO,IAAI,EAAI,IAAI,KAAG,EAAO,IAAI,EAAI,M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O;AAAA,IACpB,UAAU;AAAA,EACX,CAAA;AAEL"}
@@ -13,8 +13,8 @@ export declare const merchantBlockVariant: {
13
13
  };
14
14
  export type MerchantBlockVariant = (typeof merchantBlockVariant)[keyof typeof merchantBlockVariant];
15
15
  export interface MerchantBlockLayoutConfig {
16
- /** Merchant card, logo cascade, or ranked logos. */
17
- kind: 'single' | 'cascade' | 'ranked';
16
+ /** Merchant card or logo cascade. */
17
+ kind: 'single' | 'cascade';
18
18
  amountVariant?: 'pill' | 'text';
19
19
  /** The amount pill's horizontal padding and text weight. */
20
20
  amountPill?: Pick<AmountPillProps, 'px' | 'fontWeight'>;
@@ -34,7 +34,7 @@ export interface MerchantBlockLayoutConfig {
34
34
  borderColor?: string;
35
35
  radius?: number;
36
36
  };
37
- /** Cascade and ranked: px the tiles overlap, and each tile's drop from the top of the row per tile count. */
37
+ /** Cascade: px the tiles overlap, and each tile's drop per tile count. */
38
38
  cascade?: {
39
39
  overlap?: number;
40
40
  offsets?: CascadeOffsets;