@simplybusiness/services 2.4.3 → 2.4.5

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 (307) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/index.js +15 -12
  3. package/dist/cjs/index.js.map +2 -2
  4. package/dist/cjs/meta.json +32 -32
  5. package/dist/cjs/snowplow/Snowplow.js +3 -0
  6. package/dist/cjs/snowplow/Snowplow.js.map +2 -2
  7. package/dist/cjs/snowplow/SnowplowContext.js +15 -12
  8. package/dist/cjs/snowplow/SnowplowContext.js.map +2 -2
  9. package/dist/cjs/snowplow/event-definitions/index.js +3 -2
  10. package/dist/cjs/snowplow/event-definitions/index.js.map +2 -2
  11. package/dist/cjs/snowplow/event-definitions/questionnaire/questionnaire.js +3 -2
  12. package/dist/cjs/snowplow/event-definitions/questionnaire/questionnaire.js.map +2 -2
  13. package/dist/cjs/snowplow/index.js +15 -12
  14. package/dist/cjs/snowplow/index.js.map +2 -2
  15. package/dist/cjs/utils/testUtils.js +15 -12
  16. package/dist/cjs/utils/testUtils.js.map +2 -2
  17. package/dist/esm/{chunk-EDKZP2NB.js → chunk-2TWF6FRS.js} +4 -1
  18. package/dist/esm/{chunk-EDKZP2NB.js.map → chunk-2TWF6FRS.js.map} +2 -2
  19. package/dist/esm/{chunk-YO5FUC73.js → chunk-3VFJFBNM.js} +4 -3
  20. package/dist/esm/chunk-3VFJFBNM.js.map +7 -0
  21. package/dist/esm/{chunk-WB3C6L4X.js → chunk-RSDIB373.js} +12 -13
  22. package/dist/esm/chunk-RSDIB373.js.map +7 -0
  23. package/dist/esm/{chunk-LLSH4K4D.js → chunk-X77BVKJO.js} +2 -2
  24. package/dist/esm/index.js +4 -4
  25. package/dist/esm/meta.json +43 -43
  26. package/dist/esm/snowplow/Snowplow.js +1 -1
  27. package/dist/esm/snowplow/SnowplowContext.js +4 -4
  28. package/dist/esm/snowplow/event-definitions/index.js +2 -2
  29. package/dist/esm/snowplow/event-definitions/questionnaire/questionnaire.js +1 -1
  30. package/dist/esm/snowplow/index.js +4 -4
  31. package/dist/esm/utils/testUtils.js +4 -4
  32. package/dist/tsconfig.build.tsbuildinfo +1 -1
  33. package/dist/types/address-lookup/index.test.d.ts +1 -0
  34. package/dist/types/components/Actions/Actions.d.ts +15 -0
  35. package/dist/types/components/Actions/Actions.hidden-stories.d.ts +10 -0
  36. package/dist/types/components/Actions/Actions.stories.d.ts +10 -0
  37. package/dist/types/components/Actions/Actions.test.d.ts +1 -0
  38. package/dist/types/components/Actions/LinkOrButton.d.ts +2 -0
  39. package/dist/types/components/Actions/LinkOrButton.test.d.ts +1 -0
  40. package/dist/types/components/Actions/index.d.ts +1 -0
  41. package/dist/types/components/Footer/Address.d.ts +6 -0
  42. package/dist/types/components/Footer/Addresses.d.ts +5 -0
  43. package/dist/types/components/Footer/Copyright.d.ts +7 -0
  44. package/dist/types/components/Footer/Footer.d.ts +2 -0
  45. package/dist/types/components/Footer/Footer.stories.d.ts +7 -0
  46. package/dist/types/components/Footer/Footer.test.d.ts +1 -0
  47. package/dist/types/components/Footer/Legal.d.ts +7 -0
  48. package/dist/types/components/Footer/LegalLinks.d.ts +5 -0
  49. package/dist/types/components/Footer/OpeningHours.d.ts +2 -0
  50. package/dist/types/components/Footer/OpeningHoursEntry.d.ts +2 -0
  51. package/dist/types/components/Footer/SmallPrint.d.ts +5 -0
  52. package/dist/types/components/Footer/Support.d.ts +3 -0
  53. package/dist/types/components/Footer/Title.d.ts +5 -0
  54. package/dist/types/components/Footer/Underline.d.ts +1 -0
  55. package/dist/types/components/Footer/constants.d.ts +25 -0
  56. package/dist/types/components/Footer/index.d.ts +2 -0
  57. package/dist/types/components/Footer/types.d.ts +18 -0
  58. package/dist/types/components/Header/ContactDetails.d.ts +2 -0
  59. package/dist/types/components/Header/Header.d.ts +2 -0
  60. package/dist/types/components/Header/Header.stories.d.ts +8 -0
  61. package/dist/types/components/Header/Header.test.d.ts +1 -0
  62. package/dist/types/components/Header/Logo.d.ts +2 -0
  63. package/dist/types/components/Header/constants.d.ts +4 -0
  64. package/dist/types/components/Header/index.d.ts +3 -0
  65. package/dist/types/components/Header/mockOpeningHoursData.d.ts +4 -0
  66. package/dist/types/components/Header/types.d.ts +25 -0
  67. package/dist/types/components/HelpWidget/HelpWidget.d.ts +10 -0
  68. package/dist/types/components/HelpWidget/HelpWidget.stories.d.ts +6 -0
  69. package/dist/types/components/HelpWidget/HelpWidget.test.d.ts +1 -0
  70. package/dist/types/components/HelpWidget/index.d.ts +1 -0
  71. package/dist/types/components/MaskedField/MaskedField.d.ts +11 -0
  72. package/dist/types/components/MaskedField/MaskedField.hidden-stories.d.ts +6 -0
  73. package/dist/types/components/MaskedField/MaskedField.stories.d.ts +6 -0
  74. package/dist/types/components/MaskedField/MaskedField.test.d.ts +1 -0
  75. package/dist/types/components/MaskedField/index.d.ts +1 -0
  76. package/dist/types/components/MaskedField/inputFormatters.d.ts +10 -0
  77. package/dist/types/components/PageFlat/PageFlat.d.ts +2 -0
  78. package/dist/types/components/PageFlat/PageFlat.stories.d.ts +6 -0
  79. package/dist/types/components/PageFlat/index.d.ts +1 -0
  80. package/dist/types/components/PageNested/PageNested.d.ts +2 -0
  81. package/dist/types/components/PageNested/PageNested.stories.d.ts +6 -0
  82. package/dist/types/components/PageNested/index.d.ts +1 -0
  83. package/dist/types/components/PaymentConfirmation/PaymentConfirmation.d.ts +6 -0
  84. package/dist/types/components/PaymentConfirmation/PaymentConfirmation.hidden-stories.d.ts +6 -0
  85. package/dist/types/components/PaymentConfirmation/PaymentConfirmation.stories.d.ts +6 -0
  86. package/dist/types/components/PaymentConfirmation/PaymentConfirmation.test.d.ts +1 -0
  87. package/dist/types/components/PaymentConfirmation/index.d.ts +1 -0
  88. package/dist/types/components/PercentageTotalsQuestion/PercentageItem.d.ts +6 -0
  89. package/dist/types/components/PercentageTotalsQuestion/PercentageTotalsQuestion.d.ts +10 -0
  90. package/dist/types/components/PercentageTotalsQuestion/PercentageTotalsQuestion.hidden-stories.d.ts +6 -0
  91. package/dist/types/components/PercentageTotalsQuestion/PercentageTotalsQuestion.hiddenstories.d.ts +6 -0
  92. package/dist/types/components/PercentageTotalsQuestion/PercentageTotalsQuestion.stories.d.ts +6 -0
  93. package/dist/types/components/PercentageTotalsQuestion/PercentageTotalsQuestion.test.d.ts +1 -0
  94. package/dist/types/components/PercentageTotalsQuestion/index.d.ts +1 -0
  95. package/dist/types/components/PreFooter/LogoBbbAccreditedBusiness.d.ts +5 -0
  96. package/dist/types/components/PreFooter/LogoForbesAdvisor.d.ts +5 -0
  97. package/dist/types/components/PreFooter/PreFooter.d.ts +10 -0
  98. package/dist/types/components/PreFooter/PreFooter.stories.d.ts +6 -0
  99. package/dist/types/components/PreFooter/PreFooter.test.d.ts +1 -0
  100. package/dist/types/components/PreFooter/index.d.ts +1 -0
  101. package/dist/types/components/Question/Question.d.ts +13 -0
  102. package/dist/types/components/Question/Question.hidden-stories.d.ts +14 -0
  103. package/dist/types/components/Question/Question.stories.d.ts +14 -0
  104. package/dist/types/components/Question/Question.test.d.ts +1 -0
  105. package/dist/types/components/Question/index.d.ts +1 -0
  106. package/dist/types/components/QuestionGroup/QuestionGroup.d.ts +16 -0
  107. package/dist/types/components/QuestionGroup/QuestionGroup.hidden-stories.d.ts +6 -0
  108. package/dist/types/components/QuestionGroup/QuestionGroup.stories.d.ts +6 -0
  109. package/dist/types/components/QuestionGroup/QuestionGroup.test.d.ts +1 -0
  110. package/dist/types/components/QuestionGroup/index.d.ts +1 -0
  111. package/dist/types/components/QuestionHelp/QuestionHelp.d.ts +11 -0
  112. package/dist/types/components/QuestionHelp/QuestionHelp.test.d.ts +1 -0
  113. package/dist/types/components/QuestionHelp/index.d.ts +1 -0
  114. package/dist/types/components/QuestionHelp/question.d.ts +3 -0
  115. package/dist/types/components/Section/Section.d.ts +14 -0
  116. package/dist/types/components/Section/Section.hidden-stories.d.ts +6 -0
  117. package/dist/types/components/Section/Section.stories.d.ts +6 -0
  118. package/dist/types/components/Section/Section.test.d.ts +1 -0
  119. package/dist/types/components/Section/index.d.ts +1 -0
  120. package/dist/types/components/Steps/StepItem.d.ts +20 -0
  121. package/dist/types/components/Steps/Steps.d.ts +13 -0
  122. package/dist/types/components/Steps/Steps.hidden-stories.d.ts +6 -0
  123. package/dist/types/components/Steps/Steps.stories.d.ts +6 -0
  124. package/dist/types/components/Steps/Steps.test.d.ts +1 -0
  125. package/dist/types/components/Steps/index.d.ts +2 -0
  126. package/dist/types/components/Testimonial/Testimonial.d.ts +13 -0
  127. package/dist/types/components/Testimonial/Testimonial.hidden-stories.d.ts +6 -0
  128. package/dist/types/components/Testimonial/Testimonial.stories.d.ts +6 -0
  129. package/dist/types/components/Testimonial/Testimonial.test.d.ts +1 -0
  130. package/dist/types/components/Testimonial/index.d.ts +1 -0
  131. package/dist/types/components/ThankYou/ThankYou.d.ts +3 -0
  132. package/dist/types/components/ThankYou/ThankYou.stories.d.ts +7 -0
  133. package/dist/types/components/ThankYou/ThankYou.test.d.ts +1 -0
  134. package/dist/types/components/ThankYou/ThankYouSidebar.d.ts +1 -0
  135. package/dist/types/components/ThankYou/ThankYouText.d.ts +2 -0
  136. package/dist/types/components/ThankYou/ThankYouText.test.d.ts +1 -0
  137. package/dist/types/components/ThankYou/index.d.ts +2 -0
  138. package/dist/types/components/ThankYou/types.d.ts +17 -0
  139. package/dist/types/components/TradeSearch/SearchResults/SearchResults.d.ts +15 -0
  140. package/dist/types/components/TradeSearch/TradeSearch.d.ts +2 -0
  141. package/dist/types/components/TradeSearch/TradeSearch.stories.d.ts +6 -0
  142. package/dist/types/components/TradeSearch/components/Listing/Listing.d.ts +12 -0
  143. package/dist/types/components/TradeSearch/components/Listing/Listing.test.d.ts +1 -0
  144. package/dist/types/components/TradeSearch/components/Listing/ListingItem.d.ts +8 -0
  145. package/dist/types/components/TradeSearch/components/Listing/ListingItem.test.d.ts +1 -0
  146. package/dist/types/components/TradeSearch/components/Listing/index.d.ts +1 -0
  147. package/dist/types/components/TradeSearch/components/SearchResults/SearchResults.d.ts +2 -0
  148. package/dist/types/components/TradeSearch/components/SearchResults/SearchResults.test.d.ts +1 -0
  149. package/dist/types/components/TradeSearch/components/SearchResults/index.d.ts +1 -0
  150. package/dist/types/components/TradeSearch/components/TradeContext/TradeContext.d.ts +1 -0
  151. package/dist/types/components/TradeSearch/components/TradeContext/index.d.ts +1 -0
  152. package/dist/types/components/TradeSearch/components/index.d.ts +1 -0
  153. package/dist/types/components/TradeSearch/constants.d.ts +1 -0
  154. package/dist/types/components/TradeSearch/hooks/index.d.ts +4 -0
  155. package/dist/types/components/TradeSearch/hooks/useApiEndpoint.d.ts +1 -0
  156. package/dist/types/components/TradeSearch/hooks/useFetchTrades.d.ts +6 -0
  157. package/dist/types/components/TradeSearch/hooks/useTradeContext.d.ts +1 -0
  158. package/dist/types/components/TradeSearch/hooks/useTradeState.d.ts +6 -0
  159. package/dist/types/components/TradeSearch/index.d.ts +2 -0
  160. package/dist/types/components/TradeSearch/types.d.ts +65 -0
  161. package/dist/types/components/TradeSearch/utils/addQueryParam.d.ts +1 -0
  162. package/dist/types/components/TradeSearch/utils/index.d.ts +1 -0
  163. package/dist/types/components/TradeSelector/Header/Header.d.ts +9 -0
  164. package/dist/types/components/TradeSelector/Header/index.d.ts +1 -0
  165. package/dist/types/components/TradeSelector/Listing/Listing.d.ts +12 -0
  166. package/dist/types/components/TradeSelector/Listing/Listing.test.d.ts +1 -0
  167. package/dist/types/components/TradeSelector/Listing/ListingItem.d.ts +8 -0
  168. package/dist/types/components/TradeSelector/Listing/ListingItem.test.d.ts +1 -0
  169. package/dist/types/components/TradeSelector/Listing/index.d.ts +1 -0
  170. package/dist/types/components/TradeSelector/SearchResults/SearchResults.d.ts +15 -0
  171. package/dist/types/components/TradeSelector/SearchResults/SearchResults.test.d.ts +1 -0
  172. package/dist/types/components/TradeSelector/SearchResults/index.d.ts +1 -0
  173. package/dist/types/components/TradeSelector/TradeInput/TradeInput.d.ts +15 -0
  174. package/dist/types/components/TradeSelector/TradeInput/TradeInput.test.d.ts +1 -0
  175. package/dist/types/components/TradeSelector/TradeInput/index.d.ts +1 -0
  176. package/dist/types/components/TradeSelector/TradeSelector.d.ts +5 -0
  177. package/dist/types/components/TradeSelector/TradeSelector.stories.d.ts +10 -0
  178. package/dist/types/components/TradeSelector/TradeSelector.test.d.ts +1 -0
  179. package/dist/types/components/TradeSelector/config/development.d.ts +7 -0
  180. package/dist/types/components/TradeSelector/config/index.d.ts +18 -0
  181. package/dist/types/components/TradeSelector/config/production.d.ts +7 -0
  182. package/dist/types/components/TradeSelector/config/shared.d.ts +17 -0
  183. package/dist/types/components/TradeSelector/config/testing.d.ts +7 -0
  184. package/dist/types/components/TradeSelector/index.d.ts +2 -0
  185. package/dist/types/components/TradeSelector/jestHTMLDialogPolyfill.d.ts +1 -0
  186. package/dist/types/components/TradeSelector/mockApiResults.d.ts +13 -0
  187. package/dist/types/components/TradeSelector/types.d.ts +51 -0
  188. package/dist/types/components/TradeSelector/useFetchTrades/index.d.ts +1 -0
  189. package/dist/types/components/TradeSelector/useFetchTrades/useFetchTrades.d.ts +7 -0
  190. package/dist/types/components/TradeSelector/useTradeSelectorUrl/index.d.ts +1 -0
  191. package/dist/types/components/TradeSelector/useTradeSelectorUrl/useTradeSelectorUrl.d.ts +6 -0
  192. package/dist/types/components/TradeSelector/useTradeSelectorUrl/useTradeSelectorUrl.test.d.ts +1 -0
  193. package/dist/types/components/TrustSection/TrustSection.d.ts +10 -0
  194. package/dist/types/components/TrustSection/TrustSection.stories.d.ts +6 -0
  195. package/dist/types/components/TrustSection/TrustSection.test.d.ts +1 -0
  196. package/dist/types/components/TrustSection/index.d.ts +1 -0
  197. package/dist/types/data/page-contract-flat.d.ts +17 -0
  198. package/dist/types/data/page-contract-nested.d.ts +17 -0
  199. package/dist/types/data/page-contract-v1.d.ts +2 -0
  200. package/dist/types/data/page-contract-v2.d.ts +2 -0
  201. package/dist/types/data/scripts-mock.d.ts +44 -0
  202. package/dist/types/data/thank-you-page-mock.d.ts +44 -0
  203. package/dist/types/hooks/useOnClickOutside/index.d.ts +1 -0
  204. package/dist/types/hooks/useOnClickOutside/useOnClickOutside.d.ts +2 -0
  205. package/dist/types/hooks/useWindowEvent/index.d.ts +1 -0
  206. package/dist/types/hooks/useWindowEvent/useWindowEvent.d.ts +1 -0
  207. package/dist/types/pages/GeneralPage/GeneralPage.d.ts +2 -0
  208. package/dist/types/pages/GeneralPage/GeneralPage.stories.d.ts +6 -0
  209. package/dist/types/pages/GeneralPage/GeneralPage.test.d.ts +1 -0
  210. package/dist/types/pages/GeneralPage/Main.d.ts +5 -0
  211. package/dist/types/pages/GeneralPage/getMainComponents.d.ts +6 -0
  212. package/dist/types/pages/GeneralPage/index.d.ts +1 -0
  213. package/dist/types/pages/GeneralPage/mainComponents.d.ts +2 -0
  214. package/dist/types/pages/GeneralPage/types.d.ts +23 -0
  215. package/dist/types/pages/Page/Page.d.ts +2 -0
  216. package/dist/types/pages/Page/index.d.ts +1 -0
  217. package/dist/types/pages/Page/types.d.ts +29 -0
  218. package/dist/types/pages/Simple/Main.d.ts +5 -0
  219. package/dist/types/pages/Simple/Simple.d.ts +2 -0
  220. package/dist/types/pages/Simple/Simple.stories.d.ts +6 -0
  221. package/dist/types/pages/Simple/index.d.ts +1 -0
  222. package/dist/types/pages/Simple/useMainComponents.d.ts +3 -0
  223. package/dist/types/pages/ThankYouPage/ThankYouPage.d.ts +2 -0
  224. package/dist/types/pages/ThankYouPage/ThankYouPage.stories.d.ts +6 -0
  225. package/dist/types/pages/ThankYouPage/ThankYouPage.test.d.ts +1 -0
  226. package/dist/types/pages/ThankYouPage/index.d.ts +1 -0
  227. package/dist/types/pages/ThankYouPage/types.d.ts +10 -0
  228. package/dist/types/services/airbrake/index.d.ts +2 -0
  229. package/dist/types/services/index.d.ts +2 -0
  230. package/dist/types/services/snowplow/Snowplow.d.ts +29 -0
  231. package/dist/types/services/snowplow/SnowplowContext.d.ts +14 -0
  232. package/dist/types/services/snowplow/SnowplowContext.test.d.ts +1 -0
  233. package/dist/types/services/snowplow/contexts.d.ts +3 -0
  234. package/dist/types/services/snowplow/contexts.test.d.ts +1 -0
  235. package/dist/types/services/snowplow/event-definitions/base.d.ts +18 -0
  236. package/dist/types/services/snowplow/event-definitions/index.d.ts +2 -0
  237. package/dist/types/services/snowplow/event-definitions/qcp.d.ts +18 -0
  238. package/dist/types/services/snowplow/event-definitions.d.ts +18 -0
  239. package/dist/types/services/snowplow/getSnowplowConfig.d.ts +2 -0
  240. package/dist/types/services/snowplow/index.d.ts +6 -0
  241. package/dist/types/services/snowplow/index.test.d.ts +1 -0
  242. package/dist/types/services/snowplow/types.d.ts +37 -0
  243. package/dist/types/snowplow/SnowplowContext.test.d.ts +1 -0
  244. package/dist/types/snowplow/contexts.test.d.ts +1 -0
  245. package/dist/types/snowplow/event-definitions/events.d.ts +20 -0
  246. package/dist/types/snowplow/event-definitions/pcp.d.ts +20 -0
  247. package/dist/types/snowplow/event-definitions/progressbar.d.ts +2 -0
  248. package/dist/types/snowplow/event-definitions/questionnaire/questionnaire.test.d.ts +1 -0
  249. package/dist/types/snowplow/event-definitions/questionnaire.d.ts +2 -0
  250. package/dist/types/snowplow/event-definitions/questionnaire.test.d.ts +1 -0
  251. package/dist/types/snowplow/event-definitions/redaction.d.ts +5 -0
  252. package/dist/types/snowplow/event-definitions/shared.d.ts +2 -0
  253. package/dist/types/snowplow/event-definitions/shoppingCart.d.ts +2 -0
  254. package/dist/types/snowplow/event-definitions/thankYou.d.ts +2 -0
  255. package/dist/types/snowplow/events.d.ts +20 -0
  256. package/dist/types/snowplow/index.test.d.ts +1 -0
  257. package/dist/types/src/address-lookup/index.d.ts +15 -0
  258. package/dist/types/src/address-lookup/types.d.ts +44 -0
  259. package/dist/types/src/airbrake/index.d.ts +9 -0
  260. package/dist/types/src/index.d.ts +3 -0
  261. package/dist/types/src/mocks/eventDefinitions.d.ts +61 -0
  262. package/dist/types/src/mocks/scripts-mock.d.ts +44 -0
  263. package/dist/types/src/snowplow/Snowplow.d.ts +34 -0
  264. package/dist/types/src/snowplow/SnowplowContext.d.ts +14 -0
  265. package/dist/types/src/snowplow/constants.d.ts +1 -0
  266. package/dist/types/src/snowplow/contexts.d.ts +4 -0
  267. package/dist/types/src/snowplow/event-definitions/base.d.ts +22 -0
  268. package/dist/types/src/snowplow/event-definitions/coverage-selection.d.ts +2 -0
  269. package/dist/types/src/snowplow/event-definitions/index.d.ts +8 -0
  270. package/dist/types/src/snowplow/event-definitions/intervention.d.ts +12 -0
  271. package/dist/types/src/snowplow/event-definitions/personalised_cover.d.ts +22 -0
  272. package/dist/types/src/snowplow/event-definitions/qcp.d.ts +2 -0
  273. package/dist/types/src/snowplow/event-definitions/questionnaire/questionnaire.d.ts +2 -0
  274. package/dist/types/src/snowplow/event-definitions/questionnaire/redaction.d.ts +5 -0
  275. package/dist/types/src/snowplow/event-definitions/referral.d.ts +2 -0
  276. package/dist/types/src/snowplow/event-definitions/test-utils.d.ts +2 -0
  277. package/dist/types/src/snowplow/getSnowplowConfig.d.ts +2 -0
  278. package/dist/types/src/snowplow/index.d.ts +6 -0
  279. package/dist/types/src/snowplow/types.d.ts +54 -0
  280. package/dist/types/src/utils/index.d.ts +2 -0
  281. package/dist/types/src/utils/isObject.d.ts +1 -0
  282. package/dist/types/src/utils/testUtils.d.ts +7 -0
  283. package/dist/types/src/utils/text.d.ts +3 -0
  284. package/dist/types/tracking-helper/TrackingHelper.d.ts +15 -0
  285. package/dist/types/tracking-helper/index.d.ts +15 -0
  286. package/dist/types/types.d.ts +5 -0
  287. package/dist/types/utils/StoryContainer.d.ts +1 -0
  288. package/dist/types/utils/TrackingHelper.d.ts +15 -0
  289. package/dist/types/utils/TrustpilotProvider.d.ts +4 -0
  290. package/dist/types/utils/env.d.ts +5 -0
  291. package/dist/types/utils/env.test.d.ts +1 -0
  292. package/dist/types/utils/excludeControls.d.ts +1 -0
  293. package/dist/types/utils/excludeControls.test.d.ts +1 -0
  294. package/dist/types/utils/isObject.test.d.ts +1 -0
  295. package/dist/types/utils/spaceDelimitedList.d.ts +1 -0
  296. package/dist/types/utils/spaceDelimitedList.test.d.ts +1 -0
  297. package/dist/types/utils/text.test.d.ts +1 -0
  298. package/dist/types/vitest.config.d.ts +2 -0
  299. package/package.json +1 -1
  300. package/src/snowplow/Snowplow.ts +4 -0
  301. package/src/snowplow/SnowplowContext.tsx +10 -13
  302. package/src/snowplow/event-definitions/questionnaire/questionnaire.test.ts +43 -0
  303. package/src/snowplow/event-definitions/questionnaire/questionnaire.ts +5 -1
  304. package/src/snowplow/index.test.ts +32 -0
  305. package/dist/esm/chunk-WB3C6L4X.js.map +0 -7
  306. package/dist/esm/chunk-YO5FUC73.js.map +0 -7
  307. /package/dist/esm/{chunk-LLSH4K4D.js.map → chunk-X77BVKJO.js.map} +0 -0
@@ -0,0 +1,51 @@
1
+ import { Ref, RefAttributes } from "react";
2
+ import { DOMProps } from "@react-types/shared";
3
+ export type DialogRef = HTMLDialogElement;
4
+ export type InputRef = HTMLInputElement;
5
+ export type TradeSelectorSearchScope = "all_verticals" | "current_and_supported_verticals" | "current_vertical" | "except_current_vertical" | "usa_contractors" | "commercial_landlord_business_types" | "contractors_combined" | "supported_for_current_vertical" | "commercial_combined_manufacturer" | "commercial_combined_wholesaler" | "commercial_combined_all";
6
+ export type TradeSelectorVertical = string;
7
+ export type TradeProps = {
8
+ value: string;
9
+ vertical: string;
10
+ supported_verticals: string[] | null;
11
+ label: string;
12
+ type: string;
13
+ trade_detail: string | null;
14
+ trade_type: string | null;
15
+ blocked: boolean;
16
+ };
17
+ export type LabelProps = {
18
+ input: string;
19
+ exact: string;
20
+ suggested: string;
21
+ noResults: string;
22
+ loading: string;
23
+ description: string;
24
+ placeholder: string;
25
+ };
26
+ export type UrlProps = {
27
+ quoteRedirect: string;
28
+ tradeApi: string;
29
+ allOccupations?: string | undefined;
30
+ };
31
+ export type TradeSelectorCommonProps = {
32
+ minInput: number;
33
+ apiRequestDebounceInMs: number;
34
+ urls: Partial<UrlProps>;
35
+ onTradeSelected?: (trade: TradeProps | string) => void;
36
+ initialTrade?: string;
37
+ vertical?: TradeSelectorVertical;
38
+ searchScope?: TradeSelectorSearchScope;
39
+ };
40
+ export type TradeSelectorElementType = HTMLDivElement;
41
+ export interface TradeSelectorProps extends Partial<TradeSelectorCommonProps>, DOMProps, RefAttributes<TradeSelectorElementType> {
42
+ /** Custom class name for setting specific CSS */
43
+ className?: string;
44
+ elementType?: string | React.ElementType;
45
+ onTradeSelected?: (trade: TradeProps | string) => void;
46
+ labels?: Partial<LabelProps>;
47
+ hideLabel?: boolean;
48
+ "data-cy"?: string;
49
+ "aria-describedby"?: string;
50
+ }
51
+ export type TradeSelectorRef = Ref<TradeSelectorElementType>;
@@ -0,0 +1 @@
1
+ export * from "./useFetchTrades";
@@ -0,0 +1,7 @@
1
+ import { TradeProps } from "../types";
2
+ export declare const useFetchTrades: (endpoint: URL, debounceInMs: number) => {
3
+ isLoading: boolean;
4
+ error: Error | null;
5
+ trades: TradeProps[] | null;
6
+ fetchTrades: import("react").Dispatch<import("react").SetStateAction<boolean>>;
7
+ };
@@ -0,0 +1 @@
1
+ export * from "./useTradeSelectorUrl";
@@ -0,0 +1,6 @@
1
+ export type TradeSelectorUrlOptions = {
2
+ vertical?: string;
3
+ searchScope?: string;
4
+ site?: string;
5
+ };
6
+ export declare function useTradeSelectorUrl(tradeApi: string, userInput: string, { vertical, searchScope, site }?: TradeSelectorUrlOptions): URL;
@@ -0,0 +1,10 @@
1
+ import { Ref, RefAttributes } from "react";
2
+ import { DOMProps, ForwardedRefComponent } from "@simplybusiness/mobius";
3
+ export type TrustSectionElementType = HTMLDivElement;
4
+ export interface TrustSectionProps extends DOMProps, RefAttributes<TrustSectionElementType> {
5
+ /** Custom class name for setting specific CSS */
6
+ className?: string;
7
+ elementType?: string | React.ElementType;
8
+ }
9
+ export type TrustSectionRef = Ref<TrustSectionElementType>;
10
+ export declare const TrustSection: ForwardedRefComponent<TrustSectionProps, TrustSectionElementType>;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { TrustSection } from "./TrustSection";
3
+ type StoryType = StoryObj<typeof TrustSection>;
4
+ declare const meta: Meta<typeof TrustSection>;
5
+ export declare const Normal: StoryType;
6
+ export default meta;
@@ -0,0 +1 @@
1
+ export * from "./TrustSection";
@@ -0,0 +1,17 @@
1
+ import { FooterProps } from "../components/Footer";
2
+ import { HeaderProps } from "../components/Header";
3
+ export type PageProps = {
4
+ layout: PageLayoutProps;
5
+ };
6
+ type PageLayoutProps = {
7
+ site: string;
8
+ header: HeaderProps;
9
+ footer: FooterProps;
10
+ main: {
11
+ firstName: string;
12
+ referenceNumber: string;
13
+ contactNumber: string;
14
+ };
15
+ };
16
+ declare const pageData: PageProps;
17
+ export default pageData;
@@ -0,0 +1,17 @@
1
+ import { FooterProps } from "../components/Footer";
2
+ import { HeaderProps } from "../components/Header";
3
+ export type PageProps = {
4
+ layout: PageLayoutProps;
5
+ };
6
+ type Feature = {
7
+ name: string;
8
+ props?: HeaderProps | FooterProps | Record<string, unknown>;
9
+ };
10
+ type PageLayoutProps = {
11
+ site: string;
12
+ header: Feature[];
13
+ footer: Feature[];
14
+ main: Feature[];
15
+ };
16
+ declare const pageData: PageProps;
17
+ export default pageData;
@@ -0,0 +1,2 @@
1
+ import { GeneralPageProps } from "../pages/GeneralPage/types";
2
+ export declare const pageData: GeneralPageProps;
@@ -0,0 +1,2 @@
1
+ import { GeneralPageProps } from "../pages/GeneralPage/types";
2
+ export declare const pageData: GeneralPageProps;
@@ -0,0 +1,44 @@
1
+ export declare const pageData: {
2
+ scripts: {
3
+ metadata: {
4
+ name: string;
5
+ };
6
+ props: {
7
+ uid: string;
8
+ cookieDomain: string;
9
+ avalancheCollector: string;
10
+ appId: string;
11
+ includeGAContext: boolean;
12
+ eventMethod: string;
13
+ postPath: string;
14
+ trackActivity: boolean;
15
+ trackPageView: boolean;
16
+ pageViewContext: {
17
+ schema: string;
18
+ data: {
19
+ site: string;
20
+ vertical: string;
21
+ super_segment: string;
22
+ primary_detail: string;
23
+ journey_name: string;
24
+ journey_id: string;
25
+ page_step_name: string;
26
+ page_step_depth: number;
27
+ };
28
+ };
29
+ distributionChannelContext: {
30
+ schema: string;
31
+ data: {
32
+ service_channel_identifier: string;
33
+ };
34
+ };
35
+ serviceChannelContext: {
36
+ schema: string;
37
+ data: {
38
+ service_channel_identifier: string;
39
+ };
40
+ };
41
+ forceSecureTracker: boolean;
42
+ };
43
+ }[];
44
+ };
@@ -0,0 +1,44 @@
1
+ export declare const pageData: {
2
+ scripts: {
3
+ metadata: {
4
+ name: string;
5
+ };
6
+ props: {
7
+ uid: string;
8
+ cookieDomain: string;
9
+ avalancheCollector: string;
10
+ appId: string;
11
+ includeGAContext: boolean;
12
+ eventMethod: string;
13
+ postPath: string;
14
+ trackActivity: boolean;
15
+ trackPageView: boolean;
16
+ pageViewContext: {
17
+ schema: string;
18
+ data: {
19
+ site: string;
20
+ vertical: string;
21
+ super_segment: string;
22
+ primary_detail: string;
23
+ journey_name: string;
24
+ journey_id: string;
25
+ page_step_name: string;
26
+ page_step_depth: number;
27
+ };
28
+ };
29
+ distributionChannelContext: {
30
+ schema: string;
31
+ data: {
32
+ service_channel_identifier: string;
33
+ };
34
+ };
35
+ serviceChannelContext: {
36
+ schema: string;
37
+ data: {
38
+ service_channel_identifier: string;
39
+ };
40
+ };
41
+ forceSecureTracker: boolean;
42
+ };
43
+ }[];
44
+ };
@@ -0,0 +1 @@
1
+ export * from "./useOnClickOutside";
@@ -0,0 +1,2 @@
1
+ import { RefObject } from "react";
2
+ export declare const useOnClickOutside: (ref: RefObject<HTMLElement>, handler: (event: MouseEvent | TouchEvent) => void) => void;
@@ -0,0 +1 @@
1
+ export * from "./useWindowEvent";
@@ -0,0 +1 @@
1
+ export declare function useWindowEvent<EventType extends keyof WindowEventMap>(type: EventType, listener: (this: Window, ev: WindowEventMap[EventType]) => any, options?: AddEventListenerOptions): void;
@@ -0,0 +1,2 @@
1
+ import type { GeneralPageProps } from "./types";
2
+ export declare const GeneralPage: (props: GeneralPageProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { GeneralPage } from "./GeneralPage";
3
+ type StoryType = StoryObj<typeof GeneralPage>;
4
+ declare const meta: Meta<typeof GeneralPage>;
5
+ export declare const Normal: StoryType;
6
+ export default meta;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { FeatureProps } from "./types";
2
+ export type MainProps = {
3
+ components: FeatureProps[];
4
+ };
5
+ export declare const Main: (props: MainProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from "react";
2
+ import type { FeatureProps } from "./types";
3
+ type FeatureMapProps = Record<string, (props: unknown) => ReactNode>;
4
+ export declare const mainFeatureMap: FeatureMapProps;
5
+ export declare const getMainComponents: (components: FeatureProps[]) => ReactNode[];
6
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./GeneralPage";
@@ -0,0 +1,2 @@
1
+ import { ReactNode } from "react";
2
+ export declare const AVAILABLE_COMPONENTS: Record<string, (props: unknown) => ReactNode>;
@@ -0,0 +1,23 @@
1
+ import type { FooterProps } from "../../components/Footer";
2
+ import type { HeaderProps } from "../../components/Header";
3
+ import { ThankYouProps } from "../../components/ThankYou";
4
+ export type GeneralPageProps = {
5
+ layout: GeneralPageLayout;
6
+ };
7
+ type GeneralPageLayout = {
8
+ components: FeatureProps[];
9
+ variations?: FeatureProps[];
10
+ };
11
+ export type FeatureProps = {
12
+ metadata: MetaData;
13
+ props?: HeaderProps | FooterProps | ThankYouProps;
14
+ components?: FeatureProps[];
15
+ };
16
+ export type VariationProps = {
17
+ metadata: MetaData;
18
+ props?: Record<string, unknown>;
19
+ };
20
+ type MetaData = {
21
+ name: string;
22
+ };
23
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { PageProps } from "./types";
2
+ export declare const Page: (props: PageProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./Page";
@@ -0,0 +1,29 @@
1
+ import { ReactNode } from "react";
2
+ import type { FooterProps } from "../../components/Footer";
3
+ import type { HeaderProps } from "../../components/Header";
4
+ export type PageProps = {
5
+ layout: PageLayout;
6
+ scripts?: GenericFeatureProps[];
7
+ children?: ReactNode;
8
+ };
9
+ type StandardFeatures = HeaderProps | FooterProps | Record<string, unknown>;
10
+ type PageLayout = {
11
+ components: FeatureProps[];
12
+ variations?: GenericFeatureProps[];
13
+ };
14
+ export type FeatureProps = {
15
+ metadata: MetaData;
16
+ props?: StandardFeatures;
17
+ components?: FeatureProps[];
18
+ };
19
+ export type GenericFeatureProps = {
20
+ metadata: MetaData;
21
+ props?: Record<string, unknown>;
22
+ };
23
+ export type MetaData = {
24
+ name: string;
25
+ };
26
+ export type Replace<T, From, To> = T extends (...args: any[]) => any ? T : {
27
+ [K in keyof T]: [T[K], From] extends [From, T[K]] ? To : Replace<T[K], From, To>;
28
+ };
29
+ export {};
@@ -0,0 +1,5 @@
1
+ import { Feature } from "../../data/page-contract-v1";
2
+ export type MainProps = {
3
+ components: Feature[];
4
+ };
5
+ export declare const Main: (props: MainProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { PageProps } from "../../data/page-contract-v1";
2
+ export declare const Simple: (props: PageProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Simple } from "./Simple";
3
+ type StoryType = StoryObj<typeof Simple>;
4
+ declare const meta: Meta<typeof Simple>;
5
+ export declare const Normal: StoryType;
6
+ export default meta;
@@ -0,0 +1 @@
1
+ export * from "./Simple";
@@ -0,0 +1,3 @@
1
+ import { ReactNode } from "react";
2
+ import { Feature } from "../../data/page-contract-v1";
3
+ export declare const useMainComponents: (components: Feature[]) => ReactNode[];
@@ -0,0 +1,2 @@
1
+ import type { ThankYouPageProps } from "./types";
2
+ export declare const ThankYouPage: (props: ThankYouPageProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { ThankYouPage } from "./ThankYouPage";
3
+ type StoryType = StoryObj<typeof ThankYouPage>;
4
+ declare const meta: Meta<typeof ThankYouPage>;
5
+ export declare const Normal: StoryType;
6
+ export default meta;
@@ -0,0 +1 @@
1
+ export * from "./ThankYouPage";
@@ -0,0 +1,10 @@
1
+ import type { FooterProps } from "../../components/Footer";
2
+ import type { HeaderProps } from "../../components/Header";
3
+ import { ThankYouProps } from "../../components/ThankYou";
4
+ import { FeatureProps, MetaData, PageProps, Replace } from "../Page/types";
5
+ export type ThankYouContentProps = Pick<ThankYouProps, "firstName" | "showTrustSection" | "referenceNumber" | "phoneNumbers" | "sbDirect">;
6
+ export type ThankYouFeatureProps = {
7
+ metadata: MetaData;
8
+ props?: HeaderProps | FooterProps | ThankYouContentProps;
9
+ };
10
+ export type ThankYouPageProps = Replace<PageProps, FeatureProps, ThankYouFeatureProps>;
@@ -0,0 +1,2 @@
1
+ import { Notifier } from "@airbrake/browser";
2
+ export declare const airbrake: Notifier;
@@ -0,0 +1,2 @@
1
+ export * from "./snowplow";
2
+ export * from "./airbrake";
@@ -0,0 +1,29 @@
1
+ import { SelfDescribingJson, StructuredEvent } from "@snowplow/browser-tracker";
2
+ import { EventDefinition, TrackingProps } from "./types";
3
+ export type FrontOfficeStructuredEvent = StructuredEvent & {
4
+ serviceChannelIdentifier: string;
5
+ };
6
+ /**
7
+ * This class is an abstraction which wraps Snowplow
8
+ * and exposes common methods with other services:
9
+ * - trackEvent : sends a standard payload
10
+ * - trackUnstructEvent : sends a payload for custom schema
11
+ */
12
+ export declare class Snowplow {
13
+ avalancheTrackerName: string;
14
+ bronzeAvalancheTrackerName: string;
15
+ pvAvalancheTrackerName: string;
16
+ uid: unknown;
17
+ trackPageView: boolean;
18
+ contexts: SelfDescribingJson<Record<string, unknown>>[];
19
+ eventHandlers: Record<string, (params?: Record<string, unknown>) => void>;
20
+ constructor(props?: TrackingProps);
21
+ setContexts(contexts: SelfDescribingJson<Record<string, unknown>>[]): this;
22
+ trackView(): this;
23
+ trackEvent(event: StructuredEvent): Promise<this>;
24
+ trackUnstructEvent(event: SelfDescribingJson<Record<string, unknown>>): Promise<this>;
25
+ addEventHandlers(eventDefinitions: EventDefinition[]): this;
26
+ private addEventHandler;
27
+ private removeEventHandler;
28
+ trigger(name: string, params?: Record<string, unknown>): this;
29
+ }
@@ -0,0 +1,14 @@
1
+ import { type ReactNode } from "react";
2
+ import { Snowplow } from "./Snowplow";
3
+ import { TrackingProps } from "./types";
4
+ export interface SnowplowContextInterface {
5
+ config: TrackingProps;
6
+ snowplow?: Snowplow;
7
+ }
8
+ type ProviderProps = {
9
+ scripts: TrackingProps;
10
+ children: ReactNode;
11
+ };
12
+ export declare const SnowplowProvider: ({ scripts, children }: ProviderProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare function useSnowplowContext(): SnowplowContextInterface;
14
+ export {};
@@ -0,0 +1,3 @@
1
+ import { SelfDescribingJson } from "@snowplow/browser-tracker";
2
+ import { TrackingProps } from "./types";
3
+ export declare const getContexts: (config: TrackingProps) => SelfDescribingJson<Record<string, unknown>>[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import { EventDefinition } from "../types";
2
+ /**
3
+ * Event definitions for Snowplow
4
+ * @type {EventDefinition[]}
5
+ * @property {string} name - The name of the event, to use when triggering
6
+ * @property {string} type - The type of the event (structured | unstructured)
7
+ * @property {makePayload} makePayload
8
+ * - Function that creates the payload for the event;
9
+ * - Allows optional params object to be passed in
10
+ *
11
+ * @example
12
+ * import { Snowplow } from "./Snowplow";
13
+ * import { eventDefinitions } from "./event-definitions";
14
+ *
15
+ * const snowplow = new Snowplow();
16
+ * snowplow.addEventHandlers(eventDefinitions);
17
+ */
18
+ export declare const baseEventDefinitions: EventDefinition[];
@@ -0,0 +1,2 @@
1
+ export declare const eventDefinitions: import("..").EventDefinition[];
2
+ export declare const qcpPageEvents: import("..").EventDefinition[];
@@ -0,0 +1,18 @@
1
+ import { EventDefinition } from "../types";
2
+ /**
3
+ * Event definitions for Snowplow
4
+ * @type {EventDefinition[]}
5
+ * @property {string} name - The name of the event, to use when triggering
6
+ * @property {string} type - The type of the event (structured | unstructured)
7
+ * @property {makePayload} makePayload
8
+ * - Function that creates the payload for the event;
9
+ * - Allows optional params object to be passed in
10
+ *
11
+ * @example
12
+ * import { Snowplow } from "./Snowplow";
13
+ * import { eventDefinitions } from "./event-definitions";
14
+ *
15
+ * const snowplow = new Snowplow();
16
+ * snowplow.addEventHandlers(eventDefinitions);
17
+ */
18
+ export declare const qcpEventDefinitions: EventDefinition[];
@@ -0,0 +1,18 @@
1
+ import { EventDefinition } from "./types";
2
+ /**
3
+ * Event definitions for Snowplow
4
+ * @type {EventDefinition[]}
5
+ * @property {string} name - The name of the event, to use when triggering
6
+ * @property {string} type - The type of the event (structured | unstructured)
7
+ * @property {makePayload} makePayload
8
+ * - Function that creates the payload for the event;
9
+ * - Allows optional params object to be passed in
10
+ *
11
+ * @example
12
+ * import { Snowplow } from "./Snowplow";
13
+ * import { eventDefinitions } from "./event-definitions";
14
+ *
15
+ * const snowplow = new Snowplow();
16
+ * snowplow.addEventHandlers(eventDefinitions);
17
+ */
18
+ export declare const eventDefinitions: EventDefinition[];
@@ -0,0 +1,2 @@
1
+ import type { TrackingProps, PageDataProps } from "./types";
2
+ export declare const getSnowplowConfig: (pageData: PageDataProps) => TrackingProps | undefined;
@@ -0,0 +1,6 @@
1
+ export * from "./contexts";
2
+ export * from "./event-definitions";
3
+ export * from "./getSnowplowConfig";
4
+ export * from "./Snowplow";
5
+ export * from "./SnowplowContext";
6
+ export * from "./types";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ import { EventMethod, SelfDescribingJson, StructuredEvent } from "@snowplow/browser-tracker";
2
+ type BaseConfig = {
3
+ appId: string;
4
+ avalancheCollector: string;
5
+ eventMethod: EventMethod;
6
+ trackPageView: boolean;
7
+ includeGAContext: boolean;
8
+ uid?: string;
9
+ postPath?: string;
10
+ };
11
+ export type EnvConfig = BaseConfig & {
12
+ cookieDomain: Record<string, string>;
13
+ };
14
+ export type TrackingProps = BaseConfig & {
15
+ eventMethod: EventMethod;
16
+ cookieDomain?: string;
17
+ };
18
+ export type ChannelContext = {
19
+ schema: string;
20
+ data: Record<string, string | number>;
21
+ };
22
+ export type ChannelContexts = Record<string, ChannelContext>;
23
+ export type ArrayOneOrMore<T> = [T, ...T[]];
24
+ export type ParamsType = Record<"label" | "deviceType" | "category" | "product" | "title" | "label" | "name" | "fromValue" | "toValue", string>;
25
+ export type EventDefinition = {
26
+ name: string;
27
+ type: "structured" | "unstructured";
28
+ makePayload: (params?: Record<string, unknown>) => StructuredEvent | SelfDescribingJson<Record<string, unknown>>;
29
+ };
30
+ export interface PageDataProps extends Partial<Record<"scripts", Array<{
31
+ metadata: {
32
+ name: string;
33
+ };
34
+ props?: Record<string, unknown>;
35
+ }>>> {
36
+ }
37
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ export declare const snowplowEvents: {
2
+ limitChanged: (primaryText: string, newLimit: string) => {
3
+ label: string;
4
+ limit: string;
5
+ };
6
+ validationShown: (coverName: string, fieldName: string) => {
7
+ cover: string;
8
+ question: string;
9
+ };
10
+ coverQuestionAnswered: (questionText: string, answerValue: string) => {
11
+ question: string;
12
+ answer: string;
13
+ };
14
+ coverPresented: (primaryText: string) => {
15
+ property: string;
16
+ };
17
+ moreInfoClicked: (primaryText: string) => {
18
+ property: string;
19
+ };
20
+ };