@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,490 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs';
2
+ import { formatPromos } from '@techstuff-dev/foundation-api-utils';
3
+ import DashboardScreen from '.';
4
+ import { BTN_SIZES, BTN_VARIANTS, CardVariant } from '../../components';
5
+
6
+ const meta: Meta<typeof DashboardScreen> = {
7
+ title: 'TEMPLATES/DashboardScreen',
8
+ component: DashboardScreen,
9
+ };
10
+
11
+ type Story = StoryObj<typeof DashboardScreen>;
12
+
13
+ const ESPromos = [
14
+ {
15
+ _index: 'elasticsearch_index_nrgprodcms_promo_panels',
16
+ _id: 'entity:node/717:en',
17
+ _score: null,
18
+ _ignored: ['description.keyword'],
19
+ _source: {
20
+ _language: 'en',
21
+ image_formatted: [
22
+ 'https://assets.nrgbarrebody.app/styles/full_16_9/s3/2024-07/Screenshot%202024-07-01%20at%2016.14.25.png?itok=lAId30pt',
23
+ ],
24
+ align: ['left'],
25
+ auth_panel: [false],
26
+ button_text: ['Join Premium+'],
27
+ created: [1658310583],
28
+ description: [
29
+ '<p>This <em>NEW<strong> Sideline Sculpt</strong></em> Class will offer a comprehensive workout designed to sculpt, strengthen, and lengthen the entire sideline of the body, from the legs to the waist and core, as well as the arms. Utilizing ballet-inspired moves, this class focuses on small, controlled movements to target and tone muscles with precision. Through consistent practice, <em><span><strong>Sideline Sculpt</strong></span></em><span> is the ideal fitness class for tightening and toning the sides of your body, addressing those small areas of looseness for a more defined silhouette.</span></p><p><span>This class will launch on the </span><em><span>Premium+ subscription on July 8th.&nbsp;</span></em></p>',
30
+ ],
31
+ image: ['https://assets.nrgbarrebody.app/2024-07/Screenshot%202024-07-01%20at%2016.14.25.png'],
32
+ langcode: ['en'],
33
+ link: ['/account/subscription'],
34
+ title: ['New Class : Sideline Sculpt'],
35
+ updated: [1719844354],
36
+ uuid: ['77cb4e18-ac48-4f2e-9b8d-b0d018b662aa'],
37
+ weight: [-2],
38
+ },
39
+ sort: [1719844354],
40
+ },
41
+ ];
42
+ const formattedPromos = formatPromos(ESPromos);
43
+
44
+ const ESPromoNews = [
45
+ {
46
+ _index: 'elasticsearch_index_nrgprodcms_promo_panels',
47
+ _id: 'entity:node/668:en',
48
+ _score: null,
49
+ _ignored: ['description.keyword'],
50
+ _source: {
51
+ _language: 'en',
52
+ image_formatted: [
53
+ 'https://assets.nrgbarrebody.app/styles/full_16_9/s3/2024-07/Screenshot%202024-07-01%20at%2016.13.00.png?itok=hWGkbJ5s',
54
+ ],
55
+ align: ['right'],
56
+ auth_panel: [true],
57
+ button_text: ['Sign up to Premium+'],
58
+ created: [1649838096],
59
+ description: [
60
+ '<p>This <em>NEW<strong> Sideline Sculpt</strong></em> class offers a comprehensive workout designed to sculpt, strengthen, and lengthen the entire sideline of the body, from the legs to the waist and core, as well as the arms. Utilizing ballet-inspired moves, this class focuses on small, controlled movements to target and tone muscles with precision. Through consistent practice, <em><span><strong>Sideline Sculpt</strong></span></em><span> is the ideal fitness class for tightening and toning the sides of your body, addressing those small areas of looseness for a more defined silhouette.</span></p><p><span>This class is available in the LIVE CLASS section.</span></p>',
61
+ ],
62
+ image: ['https://assets.nrgbarrebody.app/2024-07/Screenshot%202024-07-01%20at%2016.13.00.png'],
63
+ langcode: ['en'],
64
+ link: ['/account/subscription'],
65
+ section: [71],
66
+ title: ['New Class : Sideline Sculpt'],
67
+ updated: [1720528485],
68
+ uuid: ['17e6be84-eaef-4c9c-bd99-c3e5b0c5ab9e'],
69
+ weight: [-2],
70
+ },
71
+ sort: [1720528485],
72
+ },
73
+ {
74
+ _index: 'elasticsearch_index_nrgprodcms_promo_panels',
75
+ _id: 'entity:node/717:en',
76
+ _score: null,
77
+ _ignored: ['description.keyword'],
78
+ _source: {
79
+ _language: 'en',
80
+ image_formatted: [
81
+ 'https://assets.nrgbarrebody.app/styles/full_16_9/s3/2024-07/Screenshot%202024-07-01%20at%2016.14.25.png?itok=lAId30pt',
82
+ ],
83
+ align: ['left'],
84
+ auth_panel: [false],
85
+ button_text: ['Join Premium+'],
86
+ created: [1658310583],
87
+ description: [
88
+ '<p>This <em>NEW<strong> Sideline Sculpt</strong></em> Class will offer a comprehensive workout designed to sculpt, strengthen, and lengthen the entire sideline of the body, from the legs to the waist and core, as well as the arms. Utilizing ballet-inspired moves, this class focuses on small, controlled movements to target and tone muscles with precision. Through consistent practice, <em><span><strong>Sideline Sculpt</strong></span></em><span> is the ideal fitness class for tightening and toning the sides of your body, addressing those small areas of looseness for a more defined silhouette.</span></p><p><span>This class will launch on the </span><em><span>Premium+ subscription on July 8th.&nbsp;</span></em></p>',
89
+ ],
90
+ image: ['https://assets.nrgbarrebody.app/2024-07/Screenshot%202024-07-01%20at%2016.14.25.png'],
91
+ langcode: ['en'],
92
+ link: ['/account/subscription'],
93
+ title: ['New Class : Sideline Sculpt'],
94
+ updated: [1719844354],
95
+ uuid: ['77cb4e18-ac48-4f2e-9b8d-b0d018b662aa'],
96
+ weight: [-2],
97
+ },
98
+ sort: [1719844354],
99
+ },
100
+ {
101
+ _index: 'elasticsearch_index_nrgprodcms_promo_panels',
102
+ _id: 'entity:node/1130:en',
103
+ _score: null,
104
+ _ignored: ['description.keyword'],
105
+ _source: {
106
+ _language: 'en',
107
+ image_formatted: [
108
+ 'https://assets.nrgbarrebody.app/styles/full_16_9/s3/2024-06/Screenshot%202024-06-10%20at%2014.47.43.png?itok=RSowQL-r',
109
+ ],
110
+ align: ['left'],
111
+ auth_panel: [true],
112
+ button_text: ['Wanna come with me?'],
113
+ created: [1713446631],
114
+ description: [
115
+ '<p>From the 28th of April until the 1st of May 2025, join me in St Paul de Vence in the heart of Provence, to enjoy some well deserved rest and pampering.&nbsp;<br>Join me for 3 nights at Le Mas de Pierre, a stunning eco-friendly 5* Relais &amp; Chateaux Hotel, a short 20min ride away from Nice.<br>During your stay, you will enjoy 3 NRG classes per day, delicious local food, access to the spa, a 30mn massage and a visit of St Paul de Vence.</p><p>Ask for the brochure nathalie@n-rg.co.uk</p>',
116
+ ],
117
+ image: ['https://assets.nrgbarrebody.app/2024-06/Screenshot%202024-06-10%20at%2014.47.43.png'],
118
+ langcode: ['en'],
119
+ link: ['/register'],
120
+ title: ['NRG Retreat Saint Paul de Vence, France'],
121
+ updated: [1718557090],
122
+ uuid: ['56d8e326-84f9-40e6-b13a-e4299b02da26'],
123
+ weight: [-2],
124
+ },
125
+ sort: [1718557090],
126
+ },
127
+ {
128
+ _index: 'elasticsearch_index_nrgprodcms_promo_panels',
129
+ _id: 'entity:node/553:en',
130
+ _score: null,
131
+ _source: {
132
+ _language: 'en',
133
+ image_formatted: [
134
+ 'https://assets.nrgbarrebody.app/styles/full_16_9/s3/2023-08/Screenshot%202023-08-29%20at%2016.14.29.png?itok=qjfeucKp',
135
+ ],
136
+ align: ['right'],
137
+ auth_panel: [true],
138
+ button_text: ['Get Started'],
139
+ created: [1639231613],
140
+ description: [
141
+ '<p>When 10 minutes is all you have!</p><p>Check you these series of short workouts. Take your pick between someuick full body workouts or some more focused sessions.</p>',
142
+ ],
143
+ image: ['https://assets.nrgbarrebody.app/2023-08/Screenshot%202023-08-29%20at%2016.14.29.png'],
144
+ langcode: ['en'],
145
+ section: [63],
146
+ title: ['10mn Daily Workouts'],
147
+ updated: [1718024571],
148
+ uuid: ['c8813027-a2e6-436f-9326-f0a41013e07f'],
149
+ weight: [0],
150
+ },
151
+ sort: [1718024571],
152
+ },
153
+ {
154
+ _index: 'elasticsearch_index_nrgprodcms_promo_panels',
155
+ _id: 'entity:node/1131:en',
156
+ _score: null,
157
+ _ignored: ['description.keyword'],
158
+ _source: {
159
+ _language: 'en',
160
+ image_formatted: [
161
+ 'https://assets.nrgbarrebody.app/styles/full_16_9/s3/2024-06/Screenshot%202024-06-10%20at%2014.47.43_0.png?itok=IspfEpDZ',
162
+ ],
163
+ align: ['right'],
164
+ auth_panel: [false],
165
+ button_text: ['Wanna come with me?'],
166
+ created: [1713447301],
167
+ description: [
168
+ '<p><span>From the 28th of April until the 1st of May 2025, join me in St Paul de Vence in the heart of Provence, to enjoy some well deserved rest and pampering.&nbsp;</span><br><span>Join me for 3 nights at Le Mas de Pierre, a stunning eco-friendly 5* Relais &amp; Chateaux Hotel, a short 20min ride away from Nice.</span><br><span>During your stay, you will enjoy 3 NRG classes per day, delicious local food, access to the spa, a 30mn massage and a visit of St Paul de Vence.</span></p><p>Ask for the brochure nathalie@n-rg.co.uk</p>',
169
+ ],
170
+ image: ['https://assets.nrgbarrebody.app/2024-06/Screenshot%202024-06-10%20at%2014.47.43_0.png'],
171
+ langcode: ['en'],
172
+ link: ['/register'],
173
+ title: ['NRG Retreat St Paul de Vence, France'],
174
+ updated: [1718024085],
175
+ uuid: ['8f6beb03-71de-4613-9691-63f0e7cb2ea6'],
176
+ weight: [-1],
177
+ },
178
+ sort: [1718024085],
179
+ },
180
+ {
181
+ _index: 'elasticsearch_index_nrgprodcms_promo_panels',
182
+ _id: 'entity:node/596:en',
183
+ _score: null,
184
+ _ignored: ['description.keyword'],
185
+ _source: {
186
+ _language: 'en',
187
+ align: ['center'],
188
+ auth_panel: [false],
189
+ background_video: ['https://assets.nrgbarrebody.app/2022-01/VideoPanel2%20-%20HD%201080p.mp4.mp4'],
190
+ button_text: ['Subscribe today'],
191
+ created: [1641649805],
192
+ description: [
193
+ '<p>Unlimited access to 460+ barre, Pilates, fitness fitness classes&nbsp;and targeted workouts.&nbsp;&nbsp;&nbsp;&nbsp;<br>Only \u00a34.50 per month. Cancel anytime.</p><p>Download the companion app.</p><div style="align-items:center;display:flex;justify-content:space-around;margin:auto;width:300px;"><a href="https://apps.apple.com/us/app/nrg-at-home/id1488214252?itsct=apps_box_badge&amp;itscg=30200" target="_blank"><img src="https://tools.applemediaservices.com/api/badges/download-on-the-app-store/black/en-us?size=150x50&amp;releaseDate=1592438400" alt="Download on the App Store" width="150" height="50" loading="lazy"></a> <a href="https://play.google.com/store/apps/details?id=app.nrgbarrebody&amp;gl=US&amp;pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1" target="_blank"><img src="https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png" alt="Get it on Google Play" width="194" height="75" loading="lazy"></a></div>',
194
+ ],
195
+ langcode: ['en'],
196
+ link: ['/register'],
197
+ title: ['NRG at home'],
198
+ updated: [1714459090],
199
+ uuid: ['f231daf6-511c-48a3-bad5-29ba4b7fd3c1'],
200
+ weight: [-5],
201
+ },
202
+ sort: [1714459090],
203
+ },
204
+ {
205
+ _index: 'elasticsearch_index_nrgprodcms_promo_panels',
206
+ _id: 'entity:node/598:en',
207
+ _score: null,
208
+ _source: {
209
+ _language: 'en',
210
+ align: ['left'],
211
+ auth_panel: [false],
212
+ button_text: ['Check It Out'],
213
+ created: [1641649806],
214
+ description: [
215
+ '<p>Unlimited access to over 400+ workouts varying from 10 mins to an hour in length. Suitable for all levels and ages. Workouts include NRG Signature barre, barre floor, booty blast, upper body, core, garuda, cardio barre and dance cardio classes.</p>',
216
+ ],
217
+ langcode: ['en'],
218
+ link: ['/catalogue'],
219
+ title: ['On-Demand Catalogue'],
220
+ updated: [1704111688],
221
+ uuid: ['706ca699-391f-434f-a0f3-9fb8e2cf853b'],
222
+ video: ['https://assets.nrgbarrebody.app/2022-01/catalogue-demo%20-%20SD%20480p.mp4.mp4'],
223
+ weight: [-1],
224
+ },
225
+ sort: [1704111688],
226
+ },
227
+ {
228
+ _index: 'elasticsearch_index_nrgprodcms_promo_panels',
229
+ _id: 'entity:node/626:en',
230
+ _score: null,
231
+ _source: {
232
+ _language: 'en',
233
+ background_image_formatted: [
234
+ 'https://assets.nrgbarrebody.app/s3fs-public/styles/full_16_9/public/2022-01/catalogue-banner.png?itok=TtMA6K_B',
235
+ ],
236
+ align: ['center'],
237
+ auth_panel: [true],
238
+ background_image: ['https://assets.nrgbarrebody.app/s3fs-public/2022-01/catalogue-banner.png'],
239
+ button_text: ['Catalogue'],
240
+ created: [1642710220],
241
+ description: ['<p>Access the barre workouts catalogue.</p>'],
242
+ langcode: ['en'],
243
+ link: ['/catalogue'],
244
+ title: ['Catalogue'],
245
+ updated: [1646587478],
246
+ uuid: ['da238bfa-a7ed-408b-bf00-5eca69cdbadf'],
247
+ weight: [-3],
248
+ },
249
+ sort: [1646587478],
250
+ },
251
+ ];
252
+
253
+ const formattedPromoNews = formatPromos(ESPromoNews);
254
+
255
+ export const Default: Story = {
256
+ parameters: {
257
+ layout: 'fullscreen',
258
+ },
259
+ args: {
260
+ title: 'Dashboard',
261
+ image: 'https://picsum.photos/600/400',
262
+ user: {
263
+ id: '1',
264
+ name: 'Joe Bloggs',
265
+ },
266
+ headerProps: {
267
+ loginCallback: () => console.log('Login clicked'),
268
+ isAuthenticated: false,
269
+ },
270
+ latestData: [
271
+ {
272
+ variant: CardVariant.MEDIA,
273
+ data: {
274
+ id: '1',
275
+ title: 'Barre Floor with ball',
276
+ description: 'Card description....',
277
+ image: {
278
+ src: 'https://picsum.photos/450/275',
279
+ alt: 'Placeholder image',
280
+ },
281
+ },
282
+ },
283
+ {
284
+ variant: CardVariant.MEDIA,
285
+ data: {
286
+ id: '2',
287
+ title: 'Legs and abs with ball',
288
+ description: 'Card description....',
289
+ image: {
290
+ src: 'https://picsum.photos/450/275',
291
+ alt: 'Placeholder image',
292
+ },
293
+ },
294
+ },
295
+ {
296
+ variant: CardVariant.MEDIA,
297
+ data: {
298
+ id: '3',
299
+ title: '3 x15min Arms / Legs / Glutes and Core',
300
+ description: 'Card description....',
301
+ image: {
302
+ src: 'https://picsum.photos/450/275',
303
+ alt: 'Placeholder image',
304
+ },
305
+ },
306
+ },
307
+ ],
308
+ recentdata: [
309
+ {
310
+ variant: CardVariant.MEDIA,
311
+ data: {
312
+ id: '1',
313
+ title: 'Barre Floor with ball',
314
+ description:
315
+ 'Card description.... Card description....Card description....Card description....Card description....Card description....',
316
+ image: {
317
+ src: 'https://picsum.photos/450/275',
318
+ alt: 'Placeholder image',
319
+ },
320
+ },
321
+ },
322
+ {
323
+ variant: CardVariant.MEDIA,
324
+ data: {
325
+ id: '2',
326
+ title: 'Legs and abs with ball',
327
+ description: 'Card description....',
328
+ image: {
329
+ src: 'https://picsum.photos/450/275',
330
+ alt: 'Placeholder image',
331
+ },
332
+ },
333
+ },
334
+ {
335
+ variant: CardVariant.MEDIA,
336
+ data: {
337
+ id: '3',
338
+ title: '3 x15min Arms / Legs / Glutes and Core',
339
+ description: 'Card description....',
340
+ image: {
341
+ src: 'https://picsum.photos/450/275',
342
+ alt: 'Placeholder image',
343
+ },
344
+ },
345
+ },
346
+ {
347
+ variant: CardVariant.MEDIA,
348
+ data: {
349
+ id: '4',
350
+ title: 'Barre Floor with ball',
351
+ description: 'Card description....',
352
+ image: {
353
+ src: 'https://picsum.photos/450/275',
354
+ alt: 'Placeholder image',
355
+ },
356
+ },
357
+ },
358
+ {
359
+ variant: CardVariant.MEDIA,
360
+ data: {
361
+ id: '5',
362
+ title: 'Legs and abs with ball',
363
+ description: 'Card description....',
364
+ image: {
365
+ src: 'https://picsum.photos/450/275',
366
+ alt: 'Placeholder image',
367
+ },
368
+ },
369
+ },
370
+ {
371
+ variant: CardVariant.MEDIA,
372
+ data: {
373
+ id: '6',
374
+ title: '3 x15min Arms / Legs / Glutes and Core',
375
+ description: 'Card description....',
376
+ image: {
377
+ src: 'https://picsum.photos/450/275',
378
+ alt: 'Placeholder image',
379
+ },
380
+ },
381
+ },
382
+ ],
383
+ stats: [
384
+ {
385
+ variant: CardVariant.DATA,
386
+ data: {
387
+ id: '1',
388
+ data: {
389
+ item: '+',
390
+ label: 'Workouts liked',
391
+ numberData: {
392
+ from: 0,
393
+ to: 56,
394
+ animationOptions: {
395
+ ease: 'easeInOut',
396
+ },
397
+ },
398
+ animateNumber: true,
399
+ },
400
+ },
401
+ },
402
+ {
403
+ variant: CardVariant.DATA,
404
+ data: {
405
+ id: '2',
406
+ data: {
407
+ item: '+',
408
+ label: 'Workouts completed',
409
+ numberData: {
410
+ from: 0,
411
+ to: 76,
412
+ animationOptions: {
413
+ ease: 'easeInOut',
414
+ },
415
+ },
416
+ animateNumber: true,
417
+ },
418
+ },
419
+ },
420
+ {
421
+ variant: CardVariant.DATA,
422
+ data: {
423
+ id: '2',
424
+ data: {
425
+ item: '',
426
+ label: 'Challenges Entered',
427
+ numberData: {
428
+ from: 0,
429
+ to: 3,
430
+ animationOptions: {
431
+ ease: 'easeInOut',
432
+ },
433
+ },
434
+ animateNumber: true,
435
+ },
436
+ },
437
+ },
438
+ ],
439
+ promo: {
440
+ title: formattedPromos[0].title,
441
+ description: formattedPromos[0].description,
442
+ image: formattedPromos[0].image,
443
+ buttonData: {
444
+ variant: BTN_VARIANTS.PRIMARY,
445
+ size: BTN_SIZES.MEDIUM,
446
+ children: 'New Classes',
447
+ onClick: () => console.log('Button clicked'),
448
+ },
449
+ },
450
+ news: formattedPromoNews.map(promo => ({
451
+ variant: CardVariant.MEDIA,
452
+ data: {
453
+ id: promo.uuid,
454
+ title: promo.title,
455
+ description: promo.description,
456
+ image: {
457
+ src: promo.image,
458
+ alt: 'Placeholder image',
459
+ },
460
+ htmlDetails: true,
461
+ },
462
+ })),
463
+ handleLatestDataPress: (id: string) => console.log('Latest data card clicked', id),
464
+ handleRecentDataPress: (id: string) => console.log('Recent data card clicked', id),
465
+ handleNewsDataPress: (id: string) => console.log('News card clicked', id),
466
+ subscriptionStatus: 'premium',
467
+ },
468
+ };
469
+
470
+ export const NoSubscription: Story = {
471
+ parameters: {
472
+ layout: 'fullscreen',
473
+ },
474
+ args: {
475
+ ...Default.args,
476
+ subscriptionStatus: 'none',
477
+ },
478
+ };
479
+
480
+ export const DefaultPlan: Story = {
481
+ parameters: {
482
+ layout: 'fullscreen',
483
+ },
484
+ args: {
485
+ ...Default.args,
486
+ subscriptionStatus: 'default',
487
+ },
488
+ };
489
+
490
+ export default meta;
@@ -0,0 +1,156 @@
1
+ import Screen from '../../components/Screen';
2
+ import { Props } from './DashboardScreen.types';
3
+ import { Banner, Card, Copy, DisplayHeading, Heading, HEADING_TAGS, Loader, PanelHero } from '../../components';
4
+ import { useLanguage } from '../../hooks';
5
+ import { SPACING } from '../../components/Hero/Hero.types';
6
+ import Carousel from '../../components/Carousel';
7
+
8
+ const DashboardScreen = ({
9
+ testID,
10
+ title,
11
+ image,
12
+ user,
13
+ latestData,
14
+ recentdata,
15
+ stats,
16
+ promo,
17
+ news,
18
+ statsIsLoading,
19
+ promosIsLoading,
20
+ dataIsLoading,
21
+ handleLatestDataPress,
22
+ handleRecentDataPress,
23
+ handleNewsDataPress,
24
+ subscriptionStatus,
25
+ }: Props) => {
26
+ const T = useLanguage();
27
+ const dashboardCarouselOptions = {
28
+ loop: false,
29
+ showArrows: true,
30
+ // New responsive API using Tailwind breakpoints
31
+ slidesPerView: {
32
+ base: 1, // Mobile
33
+ sm: 2, // 640px+
34
+ md: 3, // 768px+
35
+ lg: 4, // 1024px+
36
+ },
37
+ };
38
+ return (
39
+ <Screen data-testid={testID || 'DashboardScreen'} image={image}>
40
+ {title && <DisplayHeading text={title} />}
41
+ {subscriptionStatus === 'none' && (
42
+ <div className="mb-6">
43
+ <Banner
44
+ icon="mdi:star"
45
+ title="Unlock Premium Content"
46
+ text="Ready to feel the burn and boost your energy? Click here to start your 7-day NRG at home fitness trial today! (first-time sucsrcibers only)"
47
+ href="/subscription"
48
+ />
49
+ </div>
50
+ )}
51
+ {subscriptionStatus === 'default' && (
52
+ <div className="mb-6">
53
+ <Banner
54
+ icon="mdi:arrow-up-bold"
55
+ title="Upgrade to Premium+"
56
+ text="Take your workouts to the next level — upgrade to NRG Premium+ for unlimited live classes and full on-demand access. Click here to upgrade now!"
57
+ href="/subscription"
58
+ />
59
+ </div>
60
+ )}
61
+ <div>
62
+ <Copy>
63
+ {T?.UI?.WELCOME} {user?.name}
64
+ </Copy>
65
+ </div>
66
+ {statsIsLoading && (
67
+ <div className="flex flex-1 min-h-[125px] items-center justify-center">
68
+ <Loader />
69
+ </div>
70
+ )}
71
+ {!statsIsLoading && stats && (
72
+ <div className="mb-8">
73
+ <Heading tag={HEADING_TAGS.H4}>{T?.UI?.ACTIVITY}</Heading>
74
+ <div className="flex flex-row gap-4 flex-wrap">
75
+ {stats.map((stat, index) => {
76
+ return (
77
+ <div key={`${stat.data.id}-${index}`}>
78
+ <Card variant={stat.variant} data={stat.data} />
79
+ </div>
80
+ );
81
+ })}
82
+ </div>
83
+ </div>
84
+ )}
85
+ {dataIsLoading && (
86
+ <div className="flex flex-1 min-h-[125px] items-center justify-center">
87
+ <Loader />
88
+ </div>
89
+ )}
90
+ {!dataIsLoading && latestData && (
91
+ <div>
92
+ <Heading tag={HEADING_TAGS.H4}>{T?.UI?.LATEST_WORKOUTS}</Heading>
93
+ <div>
94
+ <Carousel
95
+ data={latestData}
96
+ onPressCallback={handleLatestDataPress}
97
+ carouselOptions={dashboardCarouselOptions}
98
+ />
99
+ </div>
100
+ </div>
101
+ )}
102
+ {promosIsLoading && (
103
+ <div className="flex flex-1 min-h-[125px] items-center justify-center">
104
+ <Loader />
105
+ </div>
106
+ )}
107
+ {!promosIsLoading && promo && (
108
+ <div>
109
+ <Heading tag={HEADING_TAGS.H4} flush>
110
+ {T?.UI?.OUR_FEATURE}
111
+ </Heading>
112
+ <PanelHero {...promo} withBg={true} spacing={SPACING.ATOM} />
113
+ </div>
114
+ )}
115
+ {dataIsLoading && (
116
+ <div className="flex flex-1 min-h-[125px] items-center justify-center">
117
+ <Loader />
118
+ </div>
119
+ )}
120
+ {!dataIsLoading && recentdata && (
121
+ <div>
122
+ <Heading tag={HEADING_TAGS.H4}>{T?.UI?.RECENTLY_ADDED}</Heading>
123
+ <div>
124
+ <Carousel
125
+ data={recentdata}
126
+ onPressCallback={handleRecentDataPress}
127
+ carouselOptions={dashboardCarouselOptions}
128
+ />
129
+ </div>
130
+ </div>
131
+ )}
132
+ {promosIsLoading && (
133
+ <div className="flex flex-1 min-h-[125px] items-center justify-center">
134
+ <Loader />
135
+ </div>
136
+ )}
137
+ {!promosIsLoading && news && (
138
+ <div>
139
+ <Heading tag={HEADING_TAGS.H4}>{T?.UI?.WHATS_NEW}</Heading>
140
+ <div>
141
+ <Carousel
142
+ data={news}
143
+ onPressCallback={handleNewsDataPress}
144
+ carouselOptions={dashboardCarouselOptions}
145
+ />
146
+ </div>
147
+ </div>
148
+ )}
149
+ </Screen>
150
+ );
151
+ };
152
+
153
+ DashboardScreen.displayName = 'DashboardScreen';
154
+
155
+ export default DashboardScreen;
156
+ export type { Props };
@@ -0,0 +1,28 @@
1
+ import { Props as CardProps } from '../../components/Card/Card.types';
2
+ import { Props as PanelHeroProps } from '../../components/PanelHero/PanelHero.types';
3
+ import { Props as HeaderProps } from '../../components/Header/Header.types';
4
+ import { Props as FooterProps } from '../../components/Footer/Footer.types';
5
+ export interface Props {
6
+ testID?: string;
7
+ title: string;
8
+ image?: string;
9
+ user?: {
10
+ id?: string;
11
+ name?: string;
12
+ };
13
+ latestData?: CardProps[];
14
+ recentdata?: CardProps[];
15
+ stats?: CardProps[];
16
+ promo?: PanelHeroProps;
17
+ news?: CardProps[];
18
+ statsIsLoading?: boolean;
19
+ promosIsLoading?: boolean;
20
+ dataIsLoading?: boolean;
21
+ handleLatestDataPress: (id: string) => void;
22
+ handleRecentDataPress: (id: string) => void;
23
+ handleNewsDataPress: (id: string) => void;
24
+ subscriptionStatus?: 'none' | 'default' | 'premium';
25
+ // web only props
26
+ headerProps?: HeaderProps;
27
+ footerProps?: FooterProps;
28
+ }
@@ -0,0 +1 @@
1
+ export { default } from './DashboardScreen';