@4alldigital/foundation-ui--core 3.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 (470) hide show
  1. package/LICENSE.txt +21 -0
  2. package/package.json +35 -0
  3. package/src/__mocks__/_examples/cnbc.ts +146 -0
  4. package/src/__mocks__/_examples/nrg.ts +222 -0
  5. package/src/__mocks__/empty-module.js +0 -0
  6. package/src/__mocks__/fileMock.js +3 -0
  7. package/src/__mocks__/fileTransformer.js +8 -0
  8. package/src/__mocks__/mockSearchData.js +511 -0
  9. package/src/__mocks__/nrglogo.svg +74 -0
  10. package/src/__mocks__/styleMock.js +3 -0
  11. package/src/__mocks__/tempPolyFills.js +5 -0
  12. package/src/components/Accordion/Accordion.stories.tsx +33 -0
  13. package/src/components/Accordion/Accordion.tsx +53 -0
  14. package/src/components/Accordion/Accordion.types.ts +8 -0
  15. package/src/components/Accordion/index.ts +1 -0
  16. package/src/components/AnimationCounter/AnimationCounter.stories.tsx +22 -0
  17. package/src/components/AnimationCounter/AnimationCounter.tsx +51 -0
  18. package/src/components/AnimationCounter/AnimationCounter.types.ts +10 -0
  19. package/src/components/AnimationCounter/index.ts +1 -0
  20. package/src/components/AnimationSet1/AnimationSet1.stories.tsx +36 -0
  21. package/src/components/AnimationSet1/AnimationSet1.tsx +107 -0
  22. package/src/components/AnimationSet1/AnimationSet1.types.ts +12 -0
  23. package/src/components/AnimationSet1/index.ts +1 -0
  24. package/src/components/Authenticator/Authenticator.stories.tsx +37 -0
  25. package/src/components/Authenticator/Authenticator.tsx +84 -0
  26. package/src/components/Authenticator/Authenticator.types.ts +7 -0
  27. package/src/components/Authenticator/index.ts +1 -0
  28. package/src/components/Avatar/Avatar.stories.tsx +26 -0
  29. package/src/components/Avatar/Avatar.tsx +88 -0
  30. package/src/components/Avatar/Avatar.types.ts +8 -0
  31. package/src/components/Avatar/index.ts +1 -0
  32. package/src/components/Banner/Banner.stories.tsx +59 -0
  33. package/src/components/Banner/Banner.tsx +60 -0
  34. package/src/components/Banner/Banner.types.ts +9 -0
  35. package/src/components/Banner/index.ts +1 -0
  36. package/src/components/Blockquote/Blockquote.stories.tsx +20 -0
  37. package/src/components/Blockquote/Blockquote.tsx +32 -0
  38. package/src/components/Blockquote/Blockquote.types.ts +8 -0
  39. package/src/components/Blockquote/index.ts +1 -0
  40. package/src/components/Button/Button.stories.tsx +50 -0
  41. package/src/components/Button/Button.tsx +117 -0
  42. package/src/components/Button/Button.types.ts +43 -0
  43. package/src/components/Button/index.ts +1 -0
  44. package/src/components/ButtonGroup/ButtonGroup.stories.tsx +59 -0
  45. package/src/components/ButtonGroup/ButtonGroup.tsx +35 -0
  46. package/src/components/ButtonGroup/ButtonGroup.types.ts +5 -0
  47. package/src/components/ButtonGroup/index.ts +1 -0
  48. package/src/components/Calendar/Calendar.stories.tsx +100 -0
  49. package/src/components/Calendar/Calendar.tsx +91 -0
  50. package/src/components/Calendar/Calendar.types.ts +10 -0
  51. package/src/components/Calendar/index.ts +2 -0
  52. package/src/components/Card/Card.stories.tsx +487 -0
  53. package/src/components/Card/Card.tsx +32 -0
  54. package/src/components/Card/Card.types.ts +79 -0
  55. package/src/components/Card/constants/index.ts +8 -0
  56. package/src/components/Card/index.ts +1 -0
  57. package/src/components/Card/types/CardBasic/CardBasic.tsx +262 -0
  58. package/src/components/Card/types/CardBasic/CardBasic.types.ts +7 -0
  59. package/src/components/Card/types/CardBasic/index.ts +1 -0
  60. package/src/components/Card/types/CardData/CardData.tsx +68 -0
  61. package/src/components/Card/types/CardData/CardData.types.ts +21 -0
  62. package/src/components/Card/types/CardData/index.ts +1 -0
  63. package/src/components/Card/types/CardHorz/CardHorz.tsx +80 -0
  64. package/src/components/Card/types/CardHorz/CardHorz.types.ts +8 -0
  65. package/src/components/Card/types/CardHorz/index.ts +1 -0
  66. package/src/components/Card/types/CardIcon/CardIcon.tsx +76 -0
  67. package/src/components/Card/types/CardIcon/CardIcon.types.ts +8 -0
  68. package/src/components/Card/types/CardIcon/index.ts +1 -0
  69. package/src/components/Card/types/CardMedia/CardMedia.tsx +277 -0
  70. package/src/components/Card/types/CardMedia/CardMedia.types.ts +5 -0
  71. package/src/components/Card/types/CardMedia/index.ts +1 -0
  72. package/src/components/Card/types/CardVideo/CardVideo.tsx +262 -0
  73. package/src/components/Card/types/CardVideo/CardVideo.types.ts +11 -0
  74. package/src/components/Card/types/CardVideo/index.ts +1 -0
  75. package/src/components/CardGrid/CardGrid.stories.tsx +122 -0
  76. package/src/components/CardGrid/CardGrid.tsx +25 -0
  77. package/src/components/CardGrid/CardGrid.types.ts +7 -0
  78. package/src/components/CardGrid/index.ts +1 -0
  79. package/src/components/Carousel/Carousel.stories.tsx +351 -0
  80. package/src/components/Carousel/Carousel.tsx +174 -0
  81. package/src/components/Carousel/Carousel.types.ts +32 -0
  82. package/src/components/Carousel/MIGRATION.md +156 -0
  83. package/src/components/Carousel/index.ts +1 -0
  84. package/src/components/Cart/Cart.stories.tsx +92 -0
  85. package/src/components/Cart/Cart.tsx +194 -0
  86. package/src/components/Cart/Cart.types.ts +4 -0
  87. package/src/components/Cart/index.ts +1 -0
  88. package/src/components/Checkbox/Checkbox.stories.tsx +18 -0
  89. package/src/components/Checkbox/Checkbox.tsx +38 -0
  90. package/src/components/Checkbox/Checkbox.types.ts +15 -0
  91. package/src/components/Checkbox/index.ts +1 -0
  92. package/src/components/Chip/Chip.stories.tsx +37 -0
  93. package/src/components/Chip/Chip.tsx +104 -0
  94. package/src/components/Chip/Chip.types.ts +13 -0
  95. package/src/components/Chip/index.ts +1 -0
  96. package/src/components/Collapsible/Collapsible.stories.tsx +139 -0
  97. package/src/components/Collapsible/Collapsible.tsx +75 -0
  98. package/src/components/Collapsible/Collapsible.types.ts +14 -0
  99. package/src/components/Collapsible/index.ts +3 -0
  100. package/src/components/Container/Container.stories.tsx +17 -0
  101. package/src/components/Container/Container.tsx +51 -0
  102. package/src/components/Container/Container.types.ts +17 -0
  103. package/src/components/Container/index.ts +1 -0
  104. package/src/components/ContentPageLayout/ContentPageLayout.stories.tsx +17 -0
  105. package/src/components/ContentPageLayout/ContentPageLayout.tsx +38 -0
  106. package/src/components/ContentPageLayout/ContentPageLayout.types.ts +17 -0
  107. package/src/components/ContentPageLayout/index.ts +1 -0
  108. package/src/components/ContentRowsLayout/ContentRowsLayout.stories.tsx +19 -0
  109. package/src/components/ContentRowsLayout/ContentRowsLayout.tsx +30 -0
  110. package/src/components/ContentRowsLayout/ContentRowsLayout.types.ts +15 -0
  111. package/src/components/ContentRowsLayout/index.ts +1 -0
  112. package/src/components/Copy/Copy.stories.tsx +28 -0
  113. package/src/components/Copy/Copy.tsx +43 -0
  114. package/src/components/Copy/Copy.types.tsx +53 -0
  115. package/src/components/Copy/index.tsx +1 -0
  116. package/src/components/DisplayHeading/DisplayHeading.stories.tsx +17 -0
  117. package/src/components/DisplayHeading/DisplayHeading.tsx +43 -0
  118. package/src/components/DisplayHeading/DisplayHeading.types.ts +8 -0
  119. package/src/components/DisplayHeading/index.ts +1 -0
  120. package/src/components/FileUpload/FileUpload.stories.tsx +18 -0
  121. package/src/components/FileUpload/FileUpload.tsx +41 -0
  122. package/src/components/FileUpload/FileUpload.types.ts +9 -0
  123. package/src/components/FileUpload/index.ts +1 -0
  124. package/src/components/Footer/Footer.stories.tsx +17 -0
  125. package/src/components/Footer/Footer.tsx +78 -0
  126. package/src/components/Footer/Footer.types.ts +4 -0
  127. package/src/components/Footer/index.ts +1 -0
  128. package/src/components/Form/Form.stories.tsx +81 -0
  129. package/src/components/Form/Form.tsx +98 -0
  130. package/src/components/Form/Form.types.ts +34 -0
  131. package/src/components/Form/index.ts +1 -0
  132. package/src/components/FormField/FormField.stories.tsx +205 -0
  133. package/src/components/FormField/FormField.tsx +258 -0
  134. package/src/components/FormField/FormField.types.ts +89 -0
  135. package/src/components/FormField/index.ts +1 -0
  136. package/src/components/FormSelect/FormSelect.stories.tsx +27 -0
  137. package/src/components/FormSelect/FormSelect.tsx +46 -0
  138. package/src/components/FormSelect/FormSelect.types.ts +45 -0
  139. package/src/components/FormSelect/index.ts +1 -0
  140. package/src/components/FullContentBackgroundImage/FullContentBackgroundImage.stories.tsx +18 -0
  141. package/src/components/FullContentBackgroundImage/FullContentBackgroundImage.tsx +26 -0
  142. package/src/components/FullContentBackgroundImage/FullContentBackgroundImage.types.ts +6 -0
  143. package/src/components/FullContentBackgroundImage/index.ts +1 -0
  144. package/src/components/FullScreenVideoModal/FullScreenVideoModal.stories.tsx +34 -0
  145. package/src/components/FullScreenVideoModal/FullScreenVideoModal.tsx +41 -0
  146. package/src/components/FullScreenVideoModal/FullScreenVideoModal.types.ts +9 -0
  147. package/src/components/FullScreenVideoModal/index.ts +1 -0
  148. package/src/components/Header/Header.stories.tsx +51 -0
  149. package/src/components/Header/Header.tsx +170 -0
  150. package/src/components/Header/Header.types.ts +11 -0
  151. package/src/components/Header/index.ts +1 -0
  152. package/src/components/Heading/Heading.stories.tsx +57 -0
  153. package/src/components/Heading/Heading.tsx +47 -0
  154. package/src/components/Heading/Heading.types.ts +35 -0
  155. package/src/components/Heading/index.ts +1 -0
  156. package/src/components/Hero/Hero.stories.tsx +17 -0
  157. package/src/components/Hero/Hero.tsx +28 -0
  158. package/src/components/Hero/Hero.types.ts +17 -0
  159. package/src/components/Hero/index.ts +1 -0
  160. package/src/components/Hr/Hr.stories.tsx +13 -0
  161. package/src/components/Hr/Hr.tsx +16 -0
  162. package/src/components/Hr/Hr.types.ts +3 -0
  163. package/src/components/Hr/index.ts +1 -0
  164. package/src/components/HtmlContent/HtmlContent.stories.tsx +29 -0
  165. package/src/components/HtmlContent/HtmlContent.tsx +36 -0
  166. package/src/components/HtmlContent/HtmlContent.types.ts +6 -0
  167. package/src/components/HtmlContent/index.ts +1 -0
  168. package/src/components/Icon/Icon.stories.tsx +26 -0
  169. package/src/components/Icon/Icon.tsx +24 -0
  170. package/src/components/Icon/Icon.types.ts +8 -0
  171. package/src/components/Icon/index.ts +2 -0
  172. package/src/components/Image/Image.stories.tsx +32 -0
  173. package/src/components/Image/Image.tsx +71 -0
  174. package/src/components/Image/Image.types.ts +20 -0
  175. package/src/components/Image/index.ts +1 -0
  176. package/src/components/Label/Label.stories.tsx +18 -0
  177. package/src/components/Label/Label.tsx +17 -0
  178. package/src/components/Label/Label.types.ts +9 -0
  179. package/src/components/Label/index.ts +1 -0
  180. package/src/components/Link/Link.stories.tsx +25 -0
  181. package/src/components/Link/Link.tsx +85 -0
  182. package/src/components/Link/Link.types.ts +14 -0
  183. package/src/components/Link/index.ts +1 -0
  184. package/src/components/List/List.stories.tsx +38 -0
  185. package/src/components/List/List.tsx +17 -0
  186. package/src/components/List/List.types.ts +27 -0
  187. package/src/components/List/index.ts +1 -0
  188. package/src/components/ListItem/ListItem.stories.tsx +61 -0
  189. package/src/components/ListItem/ListItem.tsx +53 -0
  190. package/src/components/ListItem/ListItem.types.ts +10 -0
  191. package/src/components/ListItem/index.ts +1 -0
  192. package/src/components/Loader/Loader.stories.tsx +17 -0
  193. package/src/components/Loader/Loader.tsx +34 -0
  194. package/src/components/Loader/Loader.types.ts +5 -0
  195. package/src/components/Loader/index.ts +1 -0
  196. package/src/components/Logo/Logo.stories.tsx +17 -0
  197. package/src/components/Logo/Logo.tsx +17 -0
  198. package/src/components/Logo/Logo.types.ts +6 -0
  199. package/src/components/Logo/index.ts +1 -0
  200. package/src/components/Menu/Menu.stories.tsx +37 -0
  201. package/src/components/Menu/Menu.tsx +45 -0
  202. package/src/components/Menu/Menu.types.ts +15 -0
  203. package/src/components/Menu/index.ts +1 -0
  204. package/src/components/Notice/Notice.stories.tsx +49 -0
  205. package/src/components/Notice/Notice.tsx +63 -0
  206. package/src/components/Notice/Notice.types.ts +11 -0
  207. package/src/components/Notice/index.ts +1 -0
  208. package/src/components/OTPInput/OTPInput.stories.tsx +18 -0
  209. package/src/components/OTPInput/OTPInput.tsx +80 -0
  210. package/src/components/OTPInput/OTPInput.types.ts +8 -0
  211. package/src/components/OTPInput/index.ts +1 -0
  212. package/src/components/PanelCards/PanelCards.stories.tsx +125 -0
  213. package/src/components/PanelCards/PanelCards.tsx +81 -0
  214. package/src/components/PanelCards/PanelCards.types.ts +11 -0
  215. package/src/components/PanelCards/index.ts +1 -0
  216. package/src/components/PanelCustom/PanelCustom.stories.tsx +18 -0
  217. package/src/components/PanelCustom/PanelCustom.tsx +39 -0
  218. package/src/components/PanelCustom/PanelCustom.types.ts +20 -0
  219. package/src/components/PanelCustom/index.ts +1 -0
  220. package/src/components/PanelFeature/PanelFeature.stories.tsx +46 -0
  221. package/src/components/PanelFeature/PanelFeature.tsx +83 -0
  222. package/src/components/PanelFeature/PanelFeature.types.ts +27 -0
  223. package/src/components/PanelFeature/index.ts +1 -0
  224. package/src/components/PanelHero/PanelHero.stories.tsx +126 -0
  225. package/src/components/PanelHero/PanelHero.tsx +184 -0
  226. package/src/components/PanelHero/PanelHero.types.ts +19 -0
  227. package/src/components/PanelHero/index.ts +1 -0
  228. package/src/components/PanelIntro/PanelIntro.stories.tsx +38 -0
  229. package/src/components/PanelIntro/PanelIntro.tsx +139 -0
  230. package/src/components/PanelIntro/PanelIntro.types.ts +19 -0
  231. package/src/components/PanelIntro/index.ts +1 -0
  232. package/src/components/PanelProduct/PanelProduct.stories.tsx +24 -0
  233. package/src/components/PanelProduct/PanelProduct.tsx +87 -0
  234. package/src/components/PanelProduct/PanelProduct.types.ts +14 -0
  235. package/src/components/PanelProduct/index.ts +1 -0
  236. package/src/components/PanelScroller/PanelScroller.stories.tsx +81 -0
  237. package/src/components/PanelScroller/PanelScroller.tsx +58 -0
  238. package/src/components/PanelScroller/PanelScroller.types.ts +8 -0
  239. package/src/components/PanelScroller/index.ts +1 -0
  240. package/src/components/PanelVideo/PanelVideo.stories.tsx +42 -0
  241. package/src/components/PanelVideo/PanelVideo.tsx +81 -0
  242. package/src/components/PanelVideo/PanelVideo.types.ts +11 -0
  243. package/src/components/PanelVideo/index.ts +1 -0
  244. package/src/components/Radio/Radio.stories.tsx +24 -0
  245. package/src/components/Radio/Radio.tsx +44 -0
  246. package/src/components/Radio/Radio.types.ts +13 -0
  247. package/src/components/Radio/index.ts +1 -0
  248. package/src/components/Schedule/Schedule.stories.tsx +96 -0
  249. package/src/components/Schedule/Schedule.tsx +118 -0
  250. package/src/components/Schedule/Schedule.types.ts +64 -0
  251. package/src/components/Schedule/index.ts +1 -0
  252. package/src/components/ScheduleItem/ScheduleItem.stories.tsx +21 -0
  253. package/src/components/ScheduleItem/ScheduleItem.tsx +77 -0
  254. package/src/components/ScheduleItem/ScheduleItem.types.ts +8 -0
  255. package/src/components/ScheduleItem/index.ts +1 -0
  256. package/src/components/Screen/Screen.stories.tsx +27 -0
  257. package/src/components/Screen/Screen.tsx +63 -0
  258. package/src/components/Screen/Screen.types.ts +16 -0
  259. package/src/components/Screen/index.ts +1 -0
  260. package/src/components/ShadcnButton/ShadcnButton.tsx +57 -0
  261. package/src/components/ShadcnButton/index.ts +2 -0
  262. package/src/components/ShadcnCarousel/ShadcnCarousel.tsx +261 -0
  263. package/src/components/ShadcnCarousel/index.ts +9 -0
  264. package/src/components/Share/Share.stories.tsx +17 -0
  265. package/src/components/Share/Share.tsx +60 -0
  266. package/src/components/Share/Share.types.ts +12 -0
  267. package/src/components/Share/index.ts +1 -0
  268. package/src/components/SubscriptionManager/SubscriptionManager.stories.tsx +177 -0
  269. package/src/components/SubscriptionManager/SubscriptionManager.tsx +369 -0
  270. package/src/components/SubscriptionManager/SubscriptionManager.types.ts +36 -0
  271. package/src/components/SubscriptionManager/index.ts +1 -0
  272. package/src/components/Switch/Switch.stories.tsx +20 -0
  273. package/src/components/Switch/Switch.tsx +30 -0
  274. package/src/components/Switch/Switch.types.ts +7 -0
  275. package/src/components/Switch/index.ts +1 -0
  276. package/src/components/Tabs/Tabs.stories.tsx +34 -0
  277. package/src/components/Tabs/Tabs.tsx +42 -0
  278. package/src/components/Tabs/Tabs.types.ts +8 -0
  279. package/src/components/Tabs/index.ts +1 -0
  280. package/src/components/TextInput/TextInput.stories.tsx +18 -0
  281. package/src/components/TextInput/TextInput.tsx +78 -0
  282. package/src/components/TextInput/TextInput.types.ts +81 -0
  283. package/src/components/TextInput/index.ts +1 -0
  284. package/src/components/Video/Video.stories.tsx +75 -0
  285. package/src/components/Video/Video.tsx +280 -0
  286. package/src/components/Video/Video.types.ts +147 -0
  287. package/src/components/Video/index.ts +1 -0
  288. package/src/components/VisitUs/VisitUs.stories.tsx +32 -0
  289. package/src/components/VisitUs/VisitUs.tsx +56 -0
  290. package/src/components/VisitUs/VisitUs.types.ts +13 -0
  291. package/src/components/VisitUs/index.ts +1 -0
  292. package/src/components/index.ts +143 -0
  293. package/src/constants/index.ts +6 -0
  294. package/src/context/Amplify/index.tsx +65 -0
  295. package/src/context/App/index.tsx +93 -0
  296. package/src/context/Cart/index.tsx +64 -0
  297. package/src/context/ExampleContext/index.tsx +34 -0
  298. package/src/context/Theme/index.tsx +37 -0
  299. package/src/context/index.ts +18 -0
  300. package/src/features/Search/Search.stories.tsx +395 -0
  301. package/src/features/Search/Search.tsx +204 -0
  302. package/src/features/Search/Search.types.ts +41 -0
  303. package/src/features/Search/config/config-helper.ts +219 -0
  304. package/src/features/Search/index.ts +1 -0
  305. package/src/features/Search/view-helpers/appendClassName.ts +14 -0
  306. package/src/features/Search/view-helpers/formatResult.ts +97 -0
  307. package/src/features/Search/view-helpers/getFilterValueDisplay.ts +10 -0
  308. package/src/features/Search/view-helpers/getUrlSanitizer.ts +23 -0
  309. package/src/features/Search/view-helpers/index.ts +4 -0
  310. package/src/features/Search/views/Layout/Layout.tsx +50 -0
  311. package/src/features/Search/views/Layout/Layout.types.ts +13 -0
  312. package/src/features/Search/views/Layout/index.ts +1 -0
  313. package/src/features/Search/views/MultiCheckboxFacet/MultiCheckboxFacet.tsx +85 -0
  314. package/src/features/Search/views/MultiCheckboxFacet/MultiCheckboxFacet.types.ts +5 -0
  315. package/src/features/Search/views/MultiCheckboxFacet/index.ts +1 -0
  316. package/src/features/Search/views/Paging/Paging.tsx +35 -0
  317. package/src/features/Search/views/Paging/Paging.types.ts +24 -0
  318. package/src/features/Search/views/Paging/index.ts +1 -0
  319. package/src/features/Search/views/PagingInfo/PagingInfo.tsx +34 -0
  320. package/src/features/Search/views/PagingInfo/PagingInfo.types.ts +26 -0
  321. package/src/features/Search/views/PagingInfo/index.ts +1 -0
  322. package/src/features/Search/views/Result/Result.tsx +84 -0
  323. package/src/features/Search/views/Result/Result.types.ts +47 -0
  324. package/src/features/Search/views/Result/index.ts +1 -0
  325. package/src/features/Search/views/Results/Results.tsx +16 -0
  326. package/src/features/Search/views/Results/Results.types.ts +24 -0
  327. package/src/features/Search/views/Results/index.ts +1 -0
  328. package/src/features/Search/views/ResultsPerPage/ResultsPerPage.tsx +32 -0
  329. package/src/features/Search/views/ResultsPerPage/ResultsPerPage.types.ts +26 -0
  330. package/src/features/Search/views/ResultsPerPage/index.ts +1 -0
  331. package/src/features/Search/views/SearchBox/SearchBox.tsx +51 -0
  332. package/src/features/Search/views/SearchBox/SearchBox.types.ts +10 -0
  333. package/src/features/Search/views/SearchBox/index.ts +1 -0
  334. package/src/features/Search/views/Sidebar/Sidebar.tsx +14 -0
  335. package/src/features/Search/views/Sidebar/Sidebar.types.ts +3 -0
  336. package/src/features/Search/views/Sidebar/index.ts +1 -0
  337. package/src/features/Search/views/SingleLinksFacet/SingleLinksFacet.tsx +62 -0
  338. package/src/features/Search/views/SingleLinksFacet/SingleLinksFacet.types.ts +5 -0
  339. package/src/features/Search/views/SingleLinksFacet/index.ts +1 -0
  340. package/src/features/Search/views/SingleSelectFacet/SingleSelectFacet.tsx +34 -0
  341. package/src/features/Search/views/SingleSelectFacet/SingleSelectFacet.types.ts +5 -0
  342. package/src/features/Search/views/SingleSelectFacet/index.ts +1 -0
  343. package/src/features/Search/views/Sorting/Sorting.tsx +24 -0
  344. package/src/features/Search/views/Sorting/Sorting.types.ts +25 -0
  345. package/src/features/Search/views/Sorting/index.ts +1 -0
  346. package/src/features/index.ts +11 -0
  347. package/src/forms/ForgotPasswordForm/ForgotPasswordForm.stories.tsx +19 -0
  348. package/src/forms/ForgotPasswordForm/ForgotPasswordForm.tsx +28 -0
  349. package/src/forms/ForgotPasswordForm/ForgotPasswordForm.types.ts +3 -0
  350. package/src/forms/ForgotPasswordForm/index.ts +1 -0
  351. package/src/forms/LoginForm/LoginForm.stories.tsx +67 -0
  352. package/src/forms/LoginForm/LoginForm.tsx +112 -0
  353. package/src/forms/LoginForm/LoginForm.types.ts +7 -0
  354. package/src/forms/LoginForm/index.ts +1 -0
  355. package/src/forms/ProfileForm/ProfileForm.stories.tsx +23 -0
  356. package/src/forms/ProfileForm/ProfileForm.tsx +40 -0
  357. package/src/forms/ProfileForm/ProfileForm.types.ts +6 -0
  358. package/src/forms/ProfileForm/index.ts +1 -0
  359. package/src/forms/PromoCodeForm/PromoCodeForm.stories.tsx +19 -0
  360. package/src/forms/PromoCodeForm/PromoCodeForm.tsx +22 -0
  361. package/src/forms/PromoCodeForm/PromoCodeForm.types.ts +4 -0
  362. package/src/forms/PromoCodeForm/index.ts +1 -0
  363. package/src/forms/RegisterForm/RegisterForm.stories.tsx +85 -0
  364. package/src/forms/RegisterForm/RegisterForm.tsx +108 -0
  365. package/src/forms/RegisterForm/RegisterForm.types.ts +6 -0
  366. package/src/forms/RegisterForm/index.ts +1 -0
  367. package/src/forms/ResetPasswordAuthForm/ResetPasswordAuthForm.stories.tsx +23 -0
  368. package/src/forms/ResetPasswordAuthForm/ResetPasswordAuthForm.tsx +39 -0
  369. package/src/forms/ResetPasswordAuthForm/ResetPasswordAuthForm.types.ts +3 -0
  370. package/src/forms/ResetPasswordAuthForm/index.ts +1 -0
  371. package/src/forms/ResetPasswordForm/ResetPasswordForm.stories.tsx +23 -0
  372. package/src/forms/ResetPasswordForm/ResetPasswordForm.tsx +30 -0
  373. package/src/forms/ResetPasswordForm/ResetPasswordForm.types.ts +3 -0
  374. package/src/forms/ResetPasswordForm/index.ts +1 -0
  375. package/src/forms/SubscriptionForm/SubscriptionForm.stories.tsx +31 -0
  376. package/src/forms/SubscriptionForm/SubscriptionForm.tsx +46 -0
  377. package/src/forms/SubscriptionForm/SubscriptionForm.types.ts +6 -0
  378. package/src/forms/SubscriptionForm/index.ts +1 -0
  379. package/src/forms/constants/index.ts +13 -0
  380. package/src/forms/index.ts +17 -0
  381. package/src/forms/validations/index.ts +39 -0
  382. package/src/hooks/index.ts +2 -0
  383. package/src/hooks/useLanguage.ts +18 -0
  384. package/src/hooks/useTheme.ts +6 -0
  385. package/src/index.ts +8 -0
  386. package/src/react-app-env.d.ts +1 -0
  387. package/src/setupTests.ts +5 -0
  388. package/src/templates/AccountScreen/AccountScreen.stories.tsx +67 -0
  389. package/src/templates/AccountScreen/AccountScreen.tsx +78 -0
  390. package/src/templates/AccountScreen/AccountScreen.types.ts +31 -0
  391. package/src/templates/AccountScreen/index.ts +1 -0
  392. package/src/templates/AuthScreen/AuthScreen.stories.tsx +33 -0
  393. package/src/templates/AuthScreen/AuthScreen.tsx +21 -0
  394. package/src/templates/AuthScreen/AuthScreen.types.ts +8 -0
  395. package/src/templates/AuthScreen/index.ts +1 -0
  396. package/src/templates/CardGridScreen/CardGridScreen.stories.tsx +95 -0
  397. package/src/templates/CardGridScreen/CardGridScreen.tsx +43 -0
  398. package/src/templates/CardGridScreen/CardGridScreen.types.ts +11 -0
  399. package/src/templates/CardGridScreen/index.ts +1 -0
  400. package/src/templates/CatalogueScreen/CatalogueScreen.stories.tsx +31 -0
  401. package/src/templates/CatalogueScreen/CatalogueScreen.tsx +21 -0
  402. package/src/templates/CatalogueScreen/CatalogueScreen.types.ts +8 -0
  403. package/src/templates/CatalogueScreen/index.ts +1 -0
  404. package/src/templates/ChallengeLibraryScreen/ChallengeLibraryScreen.stories.tsx +171 -0
  405. package/src/templates/ChallengeLibraryScreen/ChallengeLibraryScreen.tsx +36 -0
  406. package/src/templates/ChallengeLibraryScreen/ChallengeLibraryScreen.types.ts +9 -0
  407. package/src/templates/ChallengeLibraryScreen/index.ts +1 -0
  408. package/src/templates/ChallengeScreen/ChallengeScreen.stories.tsx +65 -0
  409. package/src/templates/ChallengeScreen/ChallengeScreen.tsx +88 -0
  410. package/src/templates/ChallengeScreen/ChallengeScreen.types.ts +22 -0
  411. package/src/templates/ChallengeScreen/index.ts +1 -0
  412. package/src/templates/ContentScreen/ContentScreen.stories.tsx +71 -0
  413. package/src/templates/ContentScreen/ContentScreen.tsx +55 -0
  414. package/src/templates/ContentScreen/ContentScreen.types.ts +9 -0
  415. package/src/templates/ContentScreen/index.ts +1 -0
  416. package/src/templates/DashboardScreen/DashboardScreen.stories.tsx +490 -0
  417. package/src/templates/DashboardScreen/DashboardScreen.tsx +156 -0
  418. package/src/templates/DashboardScreen/DashboardScreen.types.ts +28 -0
  419. package/src/templates/DashboardScreen/index.ts +1 -0
  420. package/src/templates/FAQScreen/FAQScreen.stories.tsx +278 -0
  421. package/src/templates/FAQScreen/FAQScreen.tsx +32 -0
  422. package/src/templates/FAQScreen/FAQScreen.types.ts +14 -0
  423. package/src/templates/FAQScreen/index.ts +1 -0
  424. package/src/templates/HomeScreen/HomeScreen.stories.tsx +315 -0
  425. package/src/templates/HomeScreen/HomeScreen.tsx +50 -0
  426. package/src/templates/HomeScreen/HomeScreen.types.ts +23 -0
  427. package/src/templates/HomeScreen/index.ts +1 -0
  428. package/src/templates/LogoutScreen/LogoutScreen.stories.tsx +20 -0
  429. package/src/templates/LogoutScreen/LogoutScreen.tsx +25 -0
  430. package/src/templates/LogoutScreen/LogoutScreen.types.ts +4 -0
  431. package/src/templates/LogoutScreen/index.ts +1 -0
  432. package/src/templates/MenuScreen/MenuScreen.stories.tsx +36 -0
  433. package/src/templates/MenuScreen/MenuScreen.tsx +32 -0
  434. package/src/templates/MenuScreen/MenuScreen.types.ts +11 -0
  435. package/src/templates/MenuScreen/index.ts +1 -0
  436. package/src/templates/NotFoundScreen/NotFoundScreen.stories.tsx +20 -0
  437. package/src/templates/NotFoundScreen/NotFoundScreen.tsx +31 -0
  438. package/src/templates/NotFoundScreen/NotFoundScreen.types.ts +5 -0
  439. package/src/templates/NotFoundScreen/index.ts +1 -0
  440. package/src/templates/PasswordResetAuthScreen/PasswordResetAuthScreen.stories.tsx +27 -0
  441. package/src/templates/PasswordResetAuthScreen/PasswordResetAuthScreen.tsx +20 -0
  442. package/src/templates/PasswordResetAuthScreen/PasswordResetAuthScreen.types.ts +6 -0
  443. package/src/templates/PasswordResetAuthScreen/index.ts +1 -0
  444. package/src/templates/PasswordResetScreen/PasswordResetScreen.stories.tsx +22 -0
  445. package/src/templates/PasswordResetScreen/PasswordResetScreen.tsx +19 -0
  446. package/src/templates/PasswordResetScreen/PasswordResetScreen.types.ts +6 -0
  447. package/src/templates/PasswordResetScreen/index.ts +1 -0
  448. package/src/templates/ProfileScreen/ProfileScreen.stories.tsx +41 -0
  449. package/src/templates/ProfileScreen/ProfileScreen.tsx +30 -0
  450. package/src/templates/ProfileScreen/ProfileScreen.types.ts +24 -0
  451. package/src/templates/ProfileScreen/index.ts +1 -0
  452. package/src/templates/ScheduleScreen/ScheduleScreen.stories.tsx +174 -0
  453. package/src/templates/ScheduleScreen/ScheduleScreen.tsx +29 -0
  454. package/src/templates/ScheduleScreen/ScheduleScreen.types.ts +9 -0
  455. package/src/templates/ScheduleScreen/index.ts +1 -0
  456. package/src/templates/SubscriptionScreen/SubscriptionScreen.stories.tsx +98 -0
  457. package/src/templates/SubscriptionScreen/SubscriptionScreen.tsx +49 -0
  458. package/src/templates/SubscriptionScreen/SubscriptionScreen.types.ts +28 -0
  459. package/src/templates/SubscriptionScreen/index.ts +1 -0
  460. package/src/templates/WorkoutScreen/WorkoutScreen.stories.tsx +173 -0
  461. package/src/templates/WorkoutScreen/WorkoutScreen.tsx +230 -0
  462. package/src/templates/WorkoutScreen/WorkoutScreen.types.ts +34 -0
  463. package/src/templates/WorkoutScreen/index.ts +1 -0
  464. package/src/templates/index.ts +40 -0
  465. package/src/translations/en.ts +777 -0
  466. package/src/translations/fr.ts +182 -0
  467. package/src/translations/index.ts +2 -0
  468. package/src/utils/htmlParser/index.tsx +22 -0
  469. package/src/utils/index.ts +38 -0
  470. package/src/utils/parseDuration/index.ts +94 -0
@@ -0,0 +1,171 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs';
2
+ import ChallengeLibraryScreen from '.';
3
+ import { CardVariant } from '../../components/Card/Card.types';
4
+
5
+ const meta: Meta<typeof ChallengeLibraryScreen> = {
6
+ title: 'TEMPLATES/ChallengeLibraryScreen',
7
+ component: ChallengeLibraryScreen,
8
+ };
9
+
10
+ type Story = StoryObj<typeof ChallengeLibraryScreen>;
11
+
12
+ export const Default: Story = {
13
+ parameters: {
14
+ layout: 'fullscreen',
15
+ },
16
+ args: {
17
+ testID: 'challenge-library',
18
+ title: 'Challenge Library',
19
+ image:
20
+ 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-10/leaner-waistline-day-cover-min_0.jpeg?itok=eipEq-20',
21
+ onPressCallback: (id: string) => console.log('ChallengeLibraryScreen Card clicked', id),
22
+ data: [
23
+ {
24
+ variant: CardVariant.MEDIA,
25
+ data: {
26
+ id: 'a927e183-aad0-4b41-b31b-qwer',
27
+ title: 'The Yinergy Challenge by Mariel Witmond',
28
+ image: {
29
+ src: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-08/main-min.png?itok=g21nbiph',
30
+ alt: 'The Yinergy Challenge by Mariel Witmond',
31
+ },
32
+ raised: true,
33
+ },
34
+ },
35
+ {
36
+ variant: CardVariant.MEDIA,
37
+ data: {
38
+ id: 'a927e183-aad0-4b41-b31b-wert',
39
+ title: '7 Days for a Leaner Waistline',
40
+ image: {
41
+ src: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-10/leaner-waistline-day-cover-min_0.jpeg?itok=eipEq-20',
42
+ alt: '7 Days for a Leaner Waistline',
43
+ },
44
+ raised: true,
45
+ },
46
+ },
47
+ {
48
+ variant: CardVariant.MEDIA,
49
+ data: {
50
+ id: 'a927e183-aad0-4b41-b31b-rtyu',
51
+ title: '12 Days of Fitness',
52
+ image: {
53
+ src: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-05/12-days-fitness-min.png?itok=apL_ikwS',
54
+ alt: '12 Days of Fitness',
55
+ },
56
+ raised: true,
57
+ },
58
+ },
59
+ {
60
+ variant: CardVariant.MEDIA,
61
+ data: {
62
+ id: 'a927e183-aad0-4b41-b31b-tyui',
63
+ title: 'Just Peachy Challenge',
64
+ image: {
65
+ src: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-05/just-peachy-challenge-min.png?itok=5iAVPtlr',
66
+ alt: 'Just Peachy Challenge',
67
+ },
68
+ raised: true,
69
+ },
70
+ },
71
+ {
72
+ variant: CardVariant.MEDIA,
73
+ data: {
74
+ id: 'a927e183-aad0-4b41-b31b-uiop',
75
+ title: 'Reset, Sweat, Reflect',
76
+ image: {
77
+ src: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-05/reset-sweat-reflect-min.png?itok=45-6K1DR',
78
+ alt: 'Reset, Sweat, Reflect',
79
+ },
80
+ raised: true,
81
+ },
82
+ },
83
+ {
84
+ variant: CardVariant.MEDIA,
85
+ data: {
86
+ id: 'a927e183-aad0-4b41-b31b-uiop',
87
+ title: '4.2 Blast Challenge',
88
+ image: {
89
+ src: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-05/4-2-challenge-min.png?itok=2cuj1nXR',
90
+ alt: '4.2 Blast Challenge',
91
+ },
92
+ raised: true,
93
+ },
94
+ },
95
+ {
96
+ variant: CardVariant.MEDIA,
97
+ data: {
98
+ id: 'a927e183-aad0-4b41-b31b-qwer',
99
+ title: 'The Yinergy Challenge by Mariel Witmond',
100
+ image: {
101
+ src: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-08/main-min.png?itok=g21nbiph',
102
+ alt: 'The Yinergy Challenge by Mariel Witmond',
103
+ },
104
+ raised: true,
105
+ },
106
+ },
107
+ {
108
+ variant: CardVariant.MEDIA,
109
+ data: {
110
+ id: 'a927e183-aad0-4b41-b31b-wert',
111
+ title: '7 Days for a Leaner Waistline',
112
+ image: {
113
+ src: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-10/leaner-waistline-day-cover-min_0.jpeg?itok=eipEq-20',
114
+ alt: '7 Days for a Leaner Waistline',
115
+ },
116
+ raised: true,
117
+ },
118
+ },
119
+ {
120
+ variant: CardVariant.MEDIA,
121
+ data: {
122
+ id: 'a927e183-aad0-4b41-b31b-rtyu',
123
+ title: '12 Days of Fitness',
124
+ image: {
125
+ src: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-05/12-days-fitness-min.png?itok=apL_ikwS',
126
+ alt: '12 Days of Fitness',
127
+ },
128
+ raised: true,
129
+ },
130
+ },
131
+ {
132
+ variant: CardVariant.MEDIA,
133
+ data: {
134
+ id: 'a927e183-aad0-4b41-b31b-tyui',
135
+ title: 'Just Peachy Challenge',
136
+ image: {
137
+ src: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-05/just-peachy-challenge-min.png?itok=5iAVPtlr',
138
+ alt: 'Just Peachy Challenge',
139
+ },
140
+ raised: true,
141
+ },
142
+ },
143
+ {
144
+ variant: CardVariant.MEDIA,
145
+ data: {
146
+ id: 'a927e183-aad0-4b41-b31b-uiop',
147
+ title: 'Reset, Sweat, Reflect',
148
+ image: {
149
+ src: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-05/reset-sweat-reflect-min.png?itok=45-6K1DR',
150
+ alt: 'Reset, Sweat, Reflect',
151
+ },
152
+ raised: true,
153
+ },
154
+ },
155
+ {
156
+ variant: CardVariant.MEDIA,
157
+ data: {
158
+ id: 'a927e183-aad0-4b41-b31b-uiop',
159
+ title: '4.2 Blast Challenge',
160
+ image: {
161
+ src: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-05/4-2-challenge-min.png?itok=2cuj1nXR',
162
+ alt: '4.2 Blast Challenge',
163
+ },
164
+ raised: true,
165
+ },
166
+ },
167
+ ],
168
+ },
169
+ };
170
+
171
+ export default meta;
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import Screen from '../../components/Screen';
3
+ import { Props } from './ChallengeLibraryScreen.types';
4
+ import DisplayHeading from '../../components/DisplayHeading';
5
+ import Loader from '../../components/Loader';
6
+ import CardGrid from '../../components/CardGrid';
7
+
8
+ const ChallengeLibraryScreen = ({
9
+ testID,
10
+ title,
11
+ image,
12
+ data,
13
+ isLoading,
14
+ onPressCallback,
15
+ }: Props) => {
16
+ return (
17
+ <Screen data-testid={testID || 'ChallengeLibraryScreen'} image={image}>
18
+ {title && <DisplayHeading text={title} />}
19
+ {isLoading && (
20
+ <div className="flex flex-1 min-h-[125px] items-center justify-center">
21
+ <Loader />
22
+ </div>
23
+ )}
24
+ {data && (
25
+ <div>
26
+ <CardGrid data={data} onPressCallback={onPressCallback} />
27
+ </div>
28
+ )}
29
+ </Screen>
30
+ );
31
+ };
32
+
33
+ ChallengeLibraryScreen.displayName = 'ChallengeLibraryScreen';
34
+
35
+ export default ChallengeLibraryScreen;
36
+ export type { Props };
@@ -0,0 +1,9 @@
1
+ import { Props as CardProps } from '../../components/Card/Card.types';
2
+ export interface Props {
3
+ testID?: string;
4
+ title: string;
5
+ image?: string;
6
+ data?: CardProps[];
7
+ isLoading?: boolean;
8
+ onPressCallback: (id: string) => void;
9
+ }
@@ -0,0 +1 @@
1
+ export { default } from './ChallengeLibraryScreen';
@@ -0,0 +1,65 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs';
2
+ import ChallengeScreen from '.';
3
+
4
+ const meta: Meta<typeof ChallengeScreen> = {
5
+ title: 'TEMPLATES/ChallengeScreen',
6
+ component: ChallengeScreen,
7
+ };
8
+
9
+ type Story = StoryObj<typeof ChallengeScreen>;
10
+
11
+ export const Default: Story = {
12
+ parameters: {
13
+ layout: 'fullscreen',
14
+ },
15
+ args: {
16
+ testID: 'challenge',
17
+ hasAccess: true, // false,
18
+ created: 1691671317,
19
+ image: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-08/main-min.png?itok=g21nbiph',
20
+ body: '<p>Mariel Witmond introduces her 7-day Yin Yoga challenge. In this challenge you will be exploring the chakras through Yin Yoga. The classes will be about 35min each in length. Each gentle posture will help you release tensions and encourage mindfulness. As you go through each class / each chakra, Mariel will be guiding you through these postures with some meditation and will discuss each chakra in details.</p>',
21
+ price: 700,
22
+ puchaseLabel: 'Purchase for £7',
23
+ title: 'The Yinergy ChallengeScreen by Mariel Witmond',
24
+ onPressCallback: (id: string) => console.log('Card clicked', id),
25
+ days: [
26
+ {
27
+ title: 'Day 1: Root Chakra',
28
+ image: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-08/main-min.png?itok=g21nbiph',
29
+ id: 'day-1',
30
+ },
31
+ {
32
+ title: 'Day 2: Sacral Chakra',
33
+ image: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-08/main-min.png?itok=g21nbiph',
34
+ id: 'day-2',
35
+ },
36
+ {
37
+ title: 'Day 3: Solar Plexus Chakra',
38
+ image: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-08/main-min.png?itok=g21nbiph',
39
+ id: 'day-3',
40
+ },
41
+ {
42
+ title: 'Day 4: Heart Chakra',
43
+ image: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-08/main-min.png?itok=g21nbiph',
44
+ id: 'day-4',
45
+ },
46
+ {
47
+ title: 'Day 5: Throat Chakra',
48
+ image: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-08/main-min.png?itok=g21nbiph',
49
+ id: 'day-5',
50
+ },
51
+ {
52
+ title: 'Day 6: Third Eye Chakra',
53
+ image: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-08/main-min.png?itok=g21nbiph',
54
+ id: 'day-6',
55
+ },
56
+ {
57
+ title: 'Day 7: Crown Chakra',
58
+ image: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-08/main-min.png?itok=g21nbiph',
59
+ id: 'day-7',
60
+ },
61
+ ],
62
+ },
63
+ };
64
+
65
+ export default meta;
@@ -0,0 +1,88 @@
1
+ import React, { useMemo } from 'react';
2
+ import { format } from 'date-fns';
3
+ import Screen from '../../components/Screen';
4
+ import { Props } from './ChallengeScreen.types';
5
+ import {
6
+ BTN_VARIANTS,
7
+ Button,
8
+ Card,
9
+ CardVariant,
10
+ Copy,
11
+ COPY_SIZE,
12
+ DisplayHeading,
13
+ HtmlContent,
14
+ Label,
15
+ } from '../../components';
16
+ import { useLanguage } from '../../hooks';
17
+ import { DATE_FORMAT } from '../../constants';
18
+
19
+ const ChallengeScreen = ({
20
+ testID,
21
+ title,
22
+ image,
23
+ created = 0,
24
+ body,
25
+ days,
26
+ puchaseLabel,
27
+ hasAccess = false,
28
+ onPressCallback,
29
+ purchaseCallback,
30
+ isLoading,
31
+ }: Props) => {
32
+ const T = useLanguage();
33
+ const formattedCreated = useMemo(() => format(new Date(created * 1000), DATE_FORMAT), [created]);
34
+
35
+ return (
36
+ <Screen data-testid={testID || 'ChallengeScreen'} image={image}>
37
+ <div>
38
+ {title && <DisplayHeading text={title} />}
39
+ <Label>
40
+ {T.UI.CREATED}: {formattedCreated}
41
+ </Label>
42
+ {!hasAccess && (
43
+ <div className="flex flex-col gap-2 mb-4">
44
+ <Copy bold className="mb-0">
45
+ {T.GLOBAL.SCREENS.CHALLENGE.NOT_ENTERED_IN_CHALLENGE}
46
+ </Copy>
47
+ <Copy className="mb-0">{T.GLOBAL.SCREENS.CHALLENGE.CLICK_TO_ENTER}</Copy>
48
+ <div>
49
+ <Button variant={BTN_VARIANTS.PRIMARY} onClick={purchaseCallback} isLoading={isLoading} disabled={isLoading}>
50
+ {puchaseLabel}
51
+ </Button>
52
+ </div>
53
+ <Copy size={COPY_SIZE.SMALL} className="mb-0">
54
+ ** {T.GLOBAL.SCREENS.CHALLENGE.PAYMENT_NOTE}
55
+ </Copy>
56
+ </div>
57
+ )}
58
+ </div>
59
+ <div>{body && <HtmlContent data={body} />}</div>
60
+ <div className="grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4">
61
+ {days?.map(day => {
62
+ return (
63
+ <Card
64
+ key={day.id}
65
+ variant={CardVariant.MEDIA}
66
+ data={{
67
+ id: day.id,
68
+ title: day.title,
69
+ image: {
70
+ src: day.image,
71
+ alt: day.title,
72
+ },
73
+ raised: true,
74
+ onClick: hasAccess ? () => onPressCallback(day.video) : undefined,
75
+ accessRestriced: !hasAccess,
76
+ }}
77
+ />
78
+ );
79
+ })}
80
+ </div>
81
+ </Screen>
82
+ );
83
+ };
84
+
85
+ ChallengeScreen.displayName = 'ChallengeScreen';
86
+
87
+ export default ChallengeScreen;
88
+ export type { Props };
@@ -0,0 +1,22 @@
1
+ interface ChallengeDay {
2
+ title: string;
3
+ image: string;
4
+ video: string;
5
+ id: string;
6
+ }
7
+
8
+ export interface Props {
9
+ testID?: string;
10
+ title: string;
11
+ image?: string;
12
+ created?: number;
13
+ body?: string;
14
+ days?: ChallengeDay[];
15
+ hasAccess?: boolean;
16
+ onPressCallback: (id: string) => void;
17
+ // Web only props
18
+ price?: number;
19
+ puchaseLabel?: string;
20
+ purchaseCallback: () => void;
21
+ isLoading?: boolean;
22
+ }
@@ -0,0 +1 @@
1
+ export { default } from './ChallengeScreen';
@@ -0,0 +1,71 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs';
2
+ import ContentScreen from '.';
3
+ import { formatPages } from '@techstuff-dev/foundation-api-utils';
4
+
5
+ const meta: Meta<typeof ContentScreen> = {
6
+ title: 'TEMPLATES/ContentScreen',
7
+ component: ContentScreen,
8
+ };
9
+
10
+ type Story = StoryObj<typeof ContentScreen>;
11
+
12
+ const ESPage = {
13
+ _index: 'elasticsearch_index_nrgprodcms_pages',
14
+ _id: 'entity:node/184:en',
15
+ _score: 1.0,
16
+ _ignored: ['body.keyword'],
17
+ _source: {
18
+ _language: 'en',
19
+ url: ['/page/privacy-policy'],
20
+ body: [
21
+ "<h4>General</h4>\n\n<p>This Privacy Policy applies to the collection, use, storage, and disclosure of customer information by N-RG. By using our website, you consent to the collection and use of information as outlined in this Privacy Policy. We will clearly disclose any exceptions to the Privacy Policy prior to collecting any information from our users.</p>\n\n<p>N-RG may decide to modify or amend this Privacy Policy from time to time. When we do, we will post any changes or new language here.</p>\n\n<p>If you are under 18, please be sure to read this policy with your parents so that you understand how your personal information will be used by N-RG. If you are under 13, please get your parent's or legal guardian's permission before giving us your e-mail address or any personal information.</p>\n\n<p>As used in this privacy policy, the word \"parent\" includes both parents and legal guardians.</p>\n\n<p>Collection and Use of Information from Users 13 and Older</p>\n\n<p>N-RG may collect contact information including your name, address, e-mail address, and other personally identifying information when you place an order or request information through our website. Contact information may be used by N-RG or shared with third parties for the purposes of processing your transaction, including fraud prevention and credit card authorization. Additionally, N-RG may use contact information to notify you about new products, promotions, and special offers that will benefit you, as well as general news about N-RG that may be of interest to you. If you are not interested in receiving this information, please email us at nathalie@n-rg.co.uk and we will remove your name from our mailing lists.</p>\n\n<p>Collection and Use of Information from Users Younger than 13 To the extent N-RG collects information from users who are younger than 13, N-RG complies with the Children's Online Privacy Protection Act (\"COPPA\"). COPPA requires that N-RG inform parents about our collection, use, and disclosure of personal information obtained from children younger than 13, and that we obtain the consent of parents before allowing those children to use certain features of our website.</p>\n\n<p>We may collect a child's personally identifiable information, including names, birthdates, and e-mail addresses, for use in promotions, surveys, requests for suggestions, requests for additional information. For children under 13, we will initially collect only the child's name and e-mail address as well as the parent's e-mail address. Before using a child's personal information for these purposes, we will send the child's parent an e-mail that informs the parent that we wish to collect and use the child's personal information and request the parent's consent to do so. We will also provide the parent a link to access this Privacy Policy, which describes our practices and policies with regard to information collection practices and use of information as required by COPPA. If the parent does not provide consent within two (2) weeks of our request, any information collected online by N-RG will be deleted from N-RG's records.</p>\n\n<p>We may also collect a child's online contact information in connection with the child's request to receive N-RG's newsletter or other e-mail communications from N-RG. In this case, we will also collect the parent's e-mail address and, before the child receives e-mail communication from us, we will notify the parent and allow them to opt out of further use of the information collected from the child.</p>\n\n<p>If N-RG collects information from a child in order to participate in an activity on the website, N-RG will not condition the child's participation on the disclosure of more information than is reasonably necessary to participate in that activity.</p>\n\n<p>Please note that parents can revoke their consent to N-RG 's collection or use of their child's personal information at any time by emailing nathalie@n-rg.co.uk with their request. Parents may also unsubscribe from our newsletters or other e-mail communications by clicking on the unsubscribe link included in those e-mails.</p>\n\n<p>Parents have the right to review their child's personal information in N-RG 's possession upon request; such requests may be submitted to nathalie@n-rg.co.uk .</p>\n\n<p>N-RG does not share a child's personally identifiable information with third parties except in the rare case that the disclosure is reasonable necessary to comply with law, or to protect the security of a child or our web site.</p>\n\n<p>Data Storage To prevent unauthorized access, maintain data accuracy, and ensure the appropriate use of information, N-RG has physical, electronic, and managerial procedures to safeguard and secure the information it collects online.</p>\n\n<p>More Information If you have any questions about anything in this Privacy Policy, or about our collection of personally identifiable information, or information generally, please contact N-RG by email: nathalie@n-rg.co.uk.</p>",
22
+ ],
23
+ created: [1578305472],
24
+ langcode: ['en'],
25
+ title: ['Privacy Policy'],
26
+ updated: [1641762291],
27
+ uuid: ['9bae61e5-549c-4f8d-b348-c4e25ea5e97e'],
28
+ },
29
+ };
30
+
31
+ const formattedPage = formatPages([ESPage])[0];
32
+
33
+ export const Default: Story = {
34
+ parameters: {
35
+ layout: 'fullscreen',
36
+ },
37
+ args: {
38
+ testID: 'cookies-policy',
39
+ title: 'Cookies Policy',
40
+ content:
41
+ "<h4>What Are Cookies</h4>\n\n<p>As is common practice with almost all professional websites this site uses cookies, which are tiny files that are downloaded to your computer, to improve your experience. This page describes what information they gather, how we use it and why we sometimes need to store these cookies. We will also share how you can prevent these cookies from being stored however this may downgrade or 'break' certain elements of the sites functionality.</p>\n\n<p>For more general information on cookies see the Wikipedia article on HTTP Cookies.</p>\n\n<h4>How We Use Cookies</h4>\n\n<p>We use cookies for a variety of reasons detailed below. Unfortunately in most cases there are no industry standard options for disabling cookies without completely disabling the functionality and features they add to this site. It is recommended that you leave on all cookies if you are not sure whether you need them or not in case they are used to provide a service that you use.</p>\n\n<h4>Disabling Cookies</h4>\n\n<p>You can prevent the setting of cookies by adjusting the settings on your browser (see your browser Help for how to do this). Be aware that disabling cookies will affect the functionality of this and many other websites that you visit. Disabling cookies will usually result in also disabling certain functionality and features of the this site. Therefore it is recommended that you do not disable cookies.</p>\n\n<h4>The Cookies We Set</h4>\n\n<p>Site preferences cookies</p>\n\n<p>* In order to provide you with a great experience on this site we provide the functionality to set your preferences for how this site runs when you use it. In order to remember your preferences we need to set cookies so that this information can be called whenever you interact with a page is affected by your preferences.</p>\n\n<h4>Third Party Cookies</h4>\n\n<p>In some special cases we also use cookies provided by trusted third parties. The following section details which third party cookies you might encounter through this site.</p>\n\n<p>This site uses Google Analytics which is one of the most widespread and trusted analytics solution on the web for helping us to understand how you use the site and ways that we can improve your experience. These cookies may track things such as how long you spend on the site and the pages that you visit so we can continue to produce engaging content. For more information on Google Analytics cookies, see the official Google Analytics page.</p>\n\n<h4>More Information</h4>\n\n<p>Hopefully that has clarified things for you and as was previously mentioned if there is something that you aren't sure whether you need or not it's usually safer to leave cookies enabled in case it does interact with one of the features you use on our site. This Cookies Policy was created with the help of the CookiePolicyGenerator.com</p>\n\n<p>However if you are still looking for more information then you can contact us through one of our preferred contact methods: Email: admin@n-rg.co.uk</p>",
42
+ },
43
+ };
44
+
45
+ export const WithImage: Story = {
46
+ parameters: {
47
+ layout: 'fullscreen',
48
+ },
49
+ args: {
50
+ testID: 'cookies-policy',
51
+ title: 'Cookies Policy',
52
+ content:
53
+ "<h4>What Are Cookies</h4>\n\n<p>As is common practice with almost all professional websites this site uses cookies, which are tiny files that are downloaded to your computer, to improve your experience. This page describes what information they gather, how we use it and why we sometimes need to store these cookies. We will also share how you can prevent these cookies from being stored however this may downgrade or 'break' certain elements of the sites functionality.</p>\n\n<p>For more general information on cookies see the Wikipedia article on HTTP Cookies.</p>\n\n<h4>How We Use Cookies</h4>\n\n<p>We use cookies for a variety of reasons detailed below. Unfortunately in most cases there are no industry standard options for disabling cookies without completely disabling the functionality and features they add to this site. It is recommended that you leave on all cookies if you are not sure whether you need them or not in case they are used to provide a service that you use.</p>\n\n<h4>Disabling Cookies</h4>\n\n<p>You can prevent the setting of cookies by adjusting the settings on your browser (see your browser Help for how to do this). Be aware that disabling cookies will affect the functionality of this and many other websites that you visit. Disabling cookies will usually result in also disabling certain functionality and features of the this site. Therefore it is recommended that you do not disable cookies.</p>\n\n<h4>The Cookies We Set</h4>\n\n<p>Site preferences cookies</p>\n\n<p>* In order to provide you with a great experience on this site we provide the functionality to set your preferences for how this site runs when you use it. In order to remember your preferences we need to set cookies so that this information can be called whenever you interact with a page is affected by your preferences.</p>\n\n<h4>Third Party Cookies</h4>\n\n<p>In some special cases we also use cookies provided by trusted third parties. The following section details which third party cookies you might encounter through this site.</p>\n\n<p>This site uses Google Analytics which is one of the most widespread and trusted analytics solution on the web for helping us to understand how you use the site and ways that we can improve your experience. These cookies may track things such as how long you spend on the site and the pages that you visit so we can continue to produce engaging content. For more information on Google Analytics cookies, see the official Google Analytics page.</p>\n\n<h4>More Information</h4>\n\n<p>Hopefully that has clarified things for you and as was previously mentioned if there is something that you aren't sure whether you need or not it's usually safer to leave cookies enabled in case it does interact with one of the features you use on our site. This Cookies Policy was created with the help of the CookiePolicyGenerator.com</p>\n\n<p>However if you are still looking for more information then you can contact us through one of our preferred contact methods: Email: admin@n-rg.co.uk</p>",
54
+ image: 'https://picsum.photos/600/400',
55
+ },
56
+ };
57
+
58
+ export const PrivacyPolicy: Story = {
59
+ parameters: {
60
+ layout: 'fullscreen',
61
+ },
62
+ args: {
63
+ testID: 'privacy-policy',
64
+ updated: 1641762291,
65
+ image: 'https://picsum.photos/600/400',
66
+ title: formattedPage.title,
67
+ content: formattedPage.body,
68
+ },
69
+ };
70
+
71
+ export default meta;
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+ import { format } from 'date-fns';
3
+ import Screen from '../../components/Screen';
4
+ import { Props } from './ContentScreen.types';
5
+ import DisplayHeading from '../../components/DisplayHeading';
6
+ import Loader from '../../components/Loader';
7
+ import HtmlContent from '../../components/HtmlContent';
8
+ import Copy from '../../components/Copy';
9
+ import { useLanguage } from '../../hooks';
10
+ import { DATE_TIME_FORMAT } from '../../constants';
11
+
12
+ const ContentScreen = ({
13
+ testID,
14
+ title,
15
+ image,
16
+ updated,
17
+ content,
18
+ isLoading,
19
+ isLayoutMinimal = false,
20
+ }: Props) => {
21
+ const T = useLanguage();
22
+ const formatUpdatedDate = updated ? format(new Date(updated * 1000), DATE_TIME_FORMAT) : undefined;
23
+
24
+ return (
25
+ <Screen
26
+ data-testid={testID || 'ContentScreen'}
27
+ image={image}
28
+ showHeader={!isLayoutMinimal}
29
+ showFooter={!isLayoutMinimal}>
30
+ {isLoading && (
31
+ <div className="flex flex-1 min-h-[125px] items-center justify-center">
32
+ <Loader />
33
+ </div>
34
+ )}
35
+ {title && <DisplayHeading text={title} />}
36
+ {updated && (
37
+ <div>
38
+ <Copy>
39
+ {T?.UI?.UPDATED}: {formatUpdatedDate}
40
+ </Copy>
41
+ </div>
42
+ )}
43
+ {content && (
44
+ <div>
45
+ <HtmlContent data={content} />
46
+ </div>
47
+ )}
48
+ </Screen>
49
+ );
50
+ };
51
+
52
+ ContentScreen.displayName = 'ContentScreen';
53
+
54
+ export default ContentScreen;
55
+ export type { Props };
@@ -0,0 +1,9 @@
1
+ export interface Props {
2
+ testID?: string;
3
+ title?: string;
4
+ image?: string;
5
+ content?: string;
6
+ updated?: number;
7
+ isLoading?: boolean;
8
+ isLayoutMinimal?: boolean;
9
+ }
@@ -0,0 +1 @@
1
+ export { default } from './ContentScreen';