@royaloperahouse/chord 0.1.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 (431) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +82 -0
  3. package/dist/chord.cjs.development.js +3611 -0
  4. package/dist/chord.cjs.development.js.map +1 -0
  5. package/dist/chord.cjs.production.min.js +2 -0
  6. package/dist/chord.cjs.production.min.js.map +1 -0
  7. package/dist/chord.esm.js +3588 -0
  8. package/dist/chord.esm.js.map +1 -0
  9. package/dist/components/atoms/Account/Account.d.ts +3 -0
  10. package/dist/components/atoms/Account/index.d.ts +2 -0
  11. package/dist/components/atoms/Basket/Basket.d.ts +3 -0
  12. package/dist/components/atoms/Basket/Basket.style.d.ts +5 -0
  13. package/dist/components/atoms/Basket/index.d.ts +2 -0
  14. package/dist/components/atoms/Buttons/Button.d.ts +4 -0
  15. package/dist/components/atoms/Buttons/Button.style.d.ts +3 -0
  16. package/dist/components/atoms/Buttons/ButtonIconWrapper.style.d.ts +2 -0
  17. package/dist/components/atoms/Buttons/Primary/PrimaryButton.d.ts +4 -0
  18. package/dist/components/atoms/Buttons/Primary/PrimaryButtonWrapper.style.d.ts +4 -0
  19. package/dist/components/atoms/Buttons/Secondary/SecondaryButton.d.ts +4 -0
  20. package/dist/components/atoms/Buttons/Secondary/SecondaryButtonWrapper.style.d.ts +4 -0
  21. package/dist/components/atoms/Buttons/Tertiary/TertiaryButton.d.ts +4 -0
  22. package/dist/components/atoms/Buttons/Tertiary/TertiaryButton.style.d.ts +4 -0
  23. package/dist/components/atoms/Buttons/index.d.ts +4 -0
  24. package/dist/components/atoms/Dropdown/Dropdown.d.ts +3 -0
  25. package/dist/components/atoms/Dropdown/Dropdown.style.d.ts +4 -0
  26. package/dist/components/atoms/Dropdown/index.d.ts +2 -0
  27. package/dist/components/atoms/Grid/Grid.d.ts +2 -0
  28. package/dist/components/atoms/Grid/GridItem.d.ts +3 -0
  29. package/dist/components/atoms/Grid/index.d.ts +3 -0
  30. package/dist/components/atoms/Heading/Heading.d.ts +3 -0
  31. package/dist/components/atoms/Heading/Heading.style.d.ts +3 -0
  32. package/dist/components/atoms/Heading/index.d.ts +2 -0
  33. package/dist/components/atoms/Icons/Icons.d.ts +4 -0
  34. package/dist/components/atoms/Icons/Icons.style.d.ts +9 -0
  35. package/dist/components/atoms/Icons/StorybookSupport/Iconography.d.ts +10 -0
  36. package/dist/components/atoms/Icons/StorybookSupport/IconsDiv.style.d.ts +2 -0
  37. package/dist/components/atoms/Icons/SvgIcons/12px/Remove.svg.d.ts +4 -0
  38. package/dist/components/atoms/Icons/SvgIcons/12px/Tick.svg.d.ts +4 -0
  39. package/dist/components/atoms/Icons/SvgIcons/Actions/AddToMyList.svg.d.ts +4 -0
  40. package/dist/components/atoms/Icons/SvgIcons/Actions/BookTickets.svg.d.ts +4 -0
  41. package/dist/components/atoms/Icons/SvgIcons/Actions/ChooseDates.svg.d.ts +4 -0
  42. package/dist/components/atoms/Icons/SvgIcons/Actions/EditMyList.svg.d.ts +4 -0
  43. package/dist/components/atoms/Icons/SvgIcons/Actions/Filter.svg.d.ts +4 -0
  44. package/dist/components/atoms/Icons/SvgIcons/Actions/FindAScreening.svg.d.ts +4 -0
  45. package/dist/components/atoms/Icons/SvgIcons/Actions/OnMyList.svg.d.ts +4 -0
  46. package/dist/components/atoms/Icons/SvgIcons/Actions/Reminder.svg.d.ts +4 -0
  47. package/dist/components/atoms/Icons/SvgIcons/Actions/Subscribe.svg.d.ts +4 -0
  48. package/dist/components/atoms/Icons/SvgIcons/Actions/Watch.svg.d.ts +4 -0
  49. package/dist/components/atoms/Icons/SvgIcons/Arrows/Arrow.svg.d.ts +4 -0
  50. package/dist/components/atoms/Icons/SvgIcons/Arrows/CarouselArrow.svg.d.ts +4 -0
  51. package/dist/components/atoms/Icons/SvgIcons/Arrows/DropdownArrow.svg.d.ts +4 -0
  52. package/dist/components/atoms/Icons/SvgIcons/Descriptors/Cinema.svg.d.ts +4 -0
  53. package/dist/components/atoms/Icons/SvgIcons/Descriptors/Clock.svg.d.ts +4 -0
  54. package/dist/components/atoms/Icons/SvgIcons/Descriptors/CreditCard.svg.d.ts +4 -0
  55. package/dist/components/atoms/Icons/SvgIcons/Descriptors/Email.svg.d.ts +4 -0
  56. package/dist/components/atoms/Icons/SvgIcons/Descriptors/Info.svg.d.ts +4 -0
  57. package/dist/components/atoms/Icons/SvgIcons/Descriptors/List.svg.d.ts +4 -0
  58. package/dist/components/atoms/Icons/SvgIcons/Descriptors/Location.svg.d.ts +4 -0
  59. package/dist/components/atoms/Icons/SvgIcons/Descriptors/PDF.svg.d.ts +4 -0
  60. package/dist/components/atoms/Icons/SvgIcons/Descriptors/Phone.svg.d.ts +4 -0
  61. package/dist/components/atoms/Icons/SvgIcons/Descriptors/Print.svg.d.ts +4 -0
  62. package/dist/components/atoms/Icons/SvgIcons/Descriptors/Secure.svg.d.ts +4 -0
  63. package/dist/components/atoms/Icons/SvgIcons/Descriptors/Tickets.svg.d.ts +4 -0
  64. package/dist/components/atoms/Icons/SvgIcons/Logos/Social/Facebook.svg.d.ts +4 -0
  65. package/dist/components/atoms/Icons/SvgIcons/Logos/Social/Instagram.svg.d.ts +4 -0
  66. package/dist/components/atoms/Icons/SvgIcons/Logos/Social/Tiktok.svg.d.ts +4 -0
  67. package/dist/components/atoms/Icons/SvgIcons/Logos/Social/Twitter.svg.d.ts +4 -0
  68. package/dist/components/atoms/Icons/SvgIcons/Logos/Social/Youtube.svg.d.ts +4 -0
  69. package/dist/components/atoms/Icons/SvgIcons/Logos/Sponsors/Sponsor.svg.d.ts +4 -0
  70. package/dist/components/atoms/Icons/SvgIcons/Navigation/BalletAndDance.svg.d.ts +4 -0
  71. package/dist/components/atoms/Icons/SvgIcons/Navigation/Basket.svg.d.ts +4 -0
  72. package/dist/components/atoms/Icons/SvgIcons/Navigation/BasketFull.svg.d.ts +4 -0
  73. package/dist/components/atoms/Icons/SvgIcons/Navigation/Home.svg.d.ts +4 -0
  74. package/dist/components/atoms/Icons/SvgIcons/Navigation/LiveStream.svg.d.ts +4 -0
  75. package/dist/components/atoms/Icons/SvgIcons/Navigation/Menu.svg.d.ts +4 -0
  76. package/dist/components/atoms/Icons/SvgIcons/Navigation/OperaAndMusic.svg.d.ts +4 -0
  77. package/dist/components/atoms/Icons/SvgIcons/Navigation/Search.svg.d.ts +4 -0
  78. package/dist/components/atoms/Icons/SvgIcons/Navigation/Settings.svg.d.ts +4 -0
  79. package/dist/components/atoms/Icons/SvgIcons/Navigation/User.svg.d.ts +4 -0
  80. package/dist/components/atoms/Icons/SvgIcons/Navigation/UserSignedIn.svg.d.ts +4 -0
  81. package/dist/components/atoms/Icons/SvgIcons/Text/Delete.svg.d.ts +4 -0
  82. package/dist/components/atoms/Icons/SvgIcons/Text/Shift.svg.d.ts +4 -0
  83. package/dist/components/atoms/Icons/SvgIcons/Text/Space.svg.d.ts +4 -0
  84. package/dist/components/atoms/Icons/SvgIcons/Utility/Close.svg.d.ts +4 -0
  85. package/dist/components/atoms/Icons/SvgIcons/Utility/Confirm.svg.d.ts +4 -0
  86. package/dist/components/atoms/Icons/SvgIcons/Utility/Detract.svg.d.ts +4 -0
  87. package/dist/components/atoms/Icons/SvgIcons/Utility/Expand.svg.d.ts +4 -0
  88. package/dist/components/atoms/Icons/SvgIcons/Utility/ExternalLink.svg.d.ts +4 -0
  89. package/dist/components/atoms/Icons/SvgIcons/Utility/GridView.svg.d.ts +4 -0
  90. package/dist/components/atoms/Icons/SvgIcons/Utility/ListView.svg.d.ts +4 -0
  91. package/dist/components/atoms/Icons/SvgIcons/Utility/Refresh.svg.d.ts +4 -0
  92. package/dist/components/atoms/Icons/SvgIcons/Video/AudioDescription.svg.d.ts +4 -0
  93. package/dist/components/atoms/Icons/SvgIcons/Video/Back10.svg.d.ts +4 -0
  94. package/dist/components/atoms/Icons/SvgIcons/Video/Clips.svg.d.ts +4 -0
  95. package/dist/components/atoms/Icons/SvgIcons/Video/Forward10.svg.d.ts +4 -0
  96. package/dist/components/atoms/Icons/SvgIcons/Video/FullScreen.svg.d.ts +4 -0
  97. package/dist/components/atoms/Icons/SvgIcons/Video/Minimise.svg.d.ts +4 -0
  98. package/dist/components/atoms/Icons/SvgIcons/Video/Muted.svg.d.ts +4 -0
  99. package/dist/components/atoms/Icons/SvgIcons/Video/Pause.svg.d.ts +4 -0
  100. package/dist/components/atoms/Icons/SvgIcons/Video/Play.svg.d.ts +4 -0
  101. package/dist/components/atoms/Icons/SvgIcons/Video/Restart.svg.d.ts +4 -0
  102. package/dist/components/atoms/Icons/SvgIcons/Video/Subtitles.svg.d.ts +4 -0
  103. package/dist/components/atoms/Icons/SvgIcons/Video/Trailer.svg.d.ts +4 -0
  104. package/dist/components/atoms/Icons/SvgIcons/Video/Volume.svg.d.ts +4 -0
  105. package/dist/components/atoms/Icons/SvgIcons/index.d.ts +71 -0
  106. package/dist/components/atoms/Icons/index.d.ts +2 -0
  107. package/dist/components/atoms/Image/Image.d.ts +38 -0
  108. package/dist/components/atoms/ImageAspectRatioWrapper/ImageAspectRatioWrapper.d.ts +3 -0
  109. package/dist/components/atoms/ImageAspectRatioWrapper/index.d.ts +2 -0
  110. package/dist/components/atoms/IndividualListing/IndividualListing.d.ts +3 -0
  111. package/dist/components/atoms/IndividualListing/IndividualListing.style.d.ts +2 -0
  112. package/dist/components/atoms/IndividualListing/index.d.ts +2 -0
  113. package/dist/components/atoms/Logo/Logo.d.ts +3 -0
  114. package/dist/components/atoms/Logo/Logo.style.d.ts +6 -0
  115. package/dist/components/atoms/Logo/index.d.ts +2 -0
  116. package/dist/components/atoms/Search/Search.d.ts +3 -0
  117. package/dist/components/atoms/Search/Search.style.d.ts +3 -0
  118. package/dist/components/atoms/Search/index.d.ts +2 -0
  119. package/dist/components/atoms/SectionSplitter/SectionSplitter.d.ts +3 -0
  120. package/dist/components/atoms/SectionSplitter/SectionSplitter.style.d.ts +2 -0
  121. package/dist/components/atoms/SectionSplitter/index.d.ts +2 -0
  122. package/dist/components/atoms/Sponsorship/Sponsorship.d.ts +4 -0
  123. package/dist/components/atoms/Sponsorship/index.d.ts +2 -0
  124. package/dist/components/atoms/Tab/Tab.d.ts +3 -0
  125. package/dist/components/atoms/Tab/Tab.style.d.ts +3 -0
  126. package/dist/components/atoms/Tab/index.d.ts +2 -0
  127. package/dist/components/atoms/TextLink/TextLink.d.ts +4 -0
  128. package/dist/components/atoms/TextLink/TextLink.style.d.ts +3 -0
  129. package/dist/components/atoms/TextLink/index.d.ts +2 -0
  130. package/dist/components/atoms/TypeTags/TypeTags.d.ts +3 -0
  131. package/dist/components/atoms/TypeTags/TypeTags.style.d.ts +2 -0
  132. package/dist/components/atoms/TypeTags/index.d.ts +2 -0
  133. package/dist/components/atoms/index.d.ts +9 -0
  134. package/dist/components/index.d.ts +6 -0
  135. package/dist/components/molecules/ContactNewsletter/ContactNewsletter.d.ts +4 -0
  136. package/dist/components/molecules/ContactNewsletter/ContactNewsletter.style.d.ts +8 -0
  137. package/dist/components/molecules/ContactNewsletter/index.d.ts +2 -0
  138. package/dist/components/molecules/Editorial/Editorial.d.ts +4 -0
  139. package/dist/components/molecules/Editorial/Editorial.style.d.ts +6 -0
  140. package/dist/components/molecules/Editorial/index.d.ts +2 -0
  141. package/dist/components/molecules/NavTop/NavTop.d.ts +3 -0
  142. package/dist/components/molecules/NavTop/NavTop.style.d.ts +1 -0
  143. package/dist/components/molecules/NavTop/index.d.ts +2 -0
  144. package/dist/components/molecules/PeopleListing/PeopleListing.d.ts +3 -0
  145. package/dist/components/molecules/PeopleListing/PeopleListing.style.d.ts +2 -0
  146. package/dist/components/molecules/PeopleListing/index.d.ts +2 -0
  147. package/dist/components/molecules/PolicyLinks/PolicyLinks.d.ts +4 -0
  148. package/dist/components/molecules/PolicyLinks/PolicyLinks.style.d.ts +3 -0
  149. package/dist/components/molecules/PolicyLinks/index.d.ts +2 -0
  150. package/dist/components/molecules/PromoWithTitle/PromoWithTitle.d.ts +4 -0
  151. package/dist/components/molecules/PromoWithTitle/PromoWithTitle.style.d.ts +8 -0
  152. package/dist/components/molecules/PromoWithTitle/index.d.ts +2 -0
  153. package/dist/components/molecules/SearchBar/SearchBar.d.ts +3 -0
  154. package/dist/components/molecules/SearchBar/SearchBar.style.d.ts +5 -0
  155. package/dist/components/molecules/SearchBar/index.d.ts +2 -0
  156. package/dist/components/molecules/SectionTitle/SectionTitle.d.ts +3 -0
  157. package/dist/components/molecules/SectionTitle/SectionTitle.style.d.ts +2 -0
  158. package/dist/components/molecules/SectionTitle/index.d.ts +2 -0
  159. package/dist/components/molecules/Tabs/Tabs.d.ts +3 -0
  160. package/dist/components/molecules/Tabs/Tabs.style.d.ts +5 -0
  161. package/dist/components/molecules/Tabs/index.d.ts +2 -0
  162. package/dist/components/molecules/TextOnly/TextOnly.d.ts +4 -0
  163. package/dist/components/molecules/TextOnly/TextOnly.style.d.ts +1 -0
  164. package/dist/components/molecules/TextOnly/index.d.ts +2 -0
  165. package/dist/components/molecules/index.d.ts +6 -0
  166. package/dist/components/organisms/Footer/Footer.d.ts +4 -0
  167. package/dist/components/organisms/Footer/Footer.style.d.ts +6 -0
  168. package/dist/components/organisms/Footer/index.d.ts +2 -0
  169. package/dist/components/organisms/Navigation/Navigation.d.ts +3 -0
  170. package/dist/components/organisms/Navigation/Navigation.style.d.ts +7 -0
  171. package/dist/components/organisms/Navigation/index.d.ts +2 -0
  172. package/dist/components/organisms/index.d.ts +3 -0
  173. package/dist/index.d.ts +3 -0
  174. package/dist/index.js +8 -0
  175. package/dist/jest.setup.d.ts +1 -0
  176. package/dist/styles/GlobalStyles.d.ts +3 -0
  177. package/dist/styles/StorybookSupport/Colours/StorybookColourBox.d.ts +5 -0
  178. package/dist/styles/ThemeProvider.d.ts +3 -0
  179. package/dist/styles/themes.d.ts +2120 -0
  180. package/dist/styles/viewports.d.ts +13 -0
  181. package/dist/types/buttonTypes.d.ts +39 -0
  182. package/dist/types/editorial.d.ts +80 -0
  183. package/dist/types/footer.d.ts +41 -0
  184. package/dist/types/iconTypes.d.ts +33 -0
  185. package/dist/types/image.d.ts +12 -0
  186. package/dist/types/index.d.ts +4 -0
  187. package/dist/types/navigation.d.ts +141 -0
  188. package/dist/types/types.d.ts +256 -0
  189. package/package.json +93 -0
  190. package/src/components/atoms/Account/Account.stories.tsx +93 -0
  191. package/src/components/atoms/Account/Account.test.tsx +54 -0
  192. package/src/components/atoms/Account/Account.tsx +25 -0
  193. package/src/components/atoms/Account/index.tsx +3 -0
  194. package/src/components/atoms/Basket/Basket.stories.tsx +79 -0
  195. package/src/components/atoms/Basket/Basket.style.tsx +74 -0
  196. package/src/components/atoms/Basket/Basket.test.tsx +35 -0
  197. package/src/components/atoms/Basket/Basket.tsx +34 -0
  198. package/src/components/atoms/Basket/index.tsx +3 -0
  199. package/src/components/atoms/Buttons/Button.style.tsx +31 -0
  200. package/src/components/atoms/Buttons/Button.tsx +21 -0
  201. package/src/components/atoms/Buttons/ButtonIconWrapper.style.tsx +10 -0
  202. package/src/components/atoms/Buttons/Buttons.stories.tsx +77 -0
  203. package/src/components/atoms/Buttons/Primary/PrimaryButton.stories.tsx +94 -0
  204. package/src/components/atoms/Buttons/Primary/PrimaryButton.test.tsx +39 -0
  205. package/src/components/atoms/Buttons/Primary/PrimaryButton.tsx +14 -0
  206. package/src/components/atoms/Buttons/Primary/PrimaryButtonWrapper.style.tsx +11 -0
  207. package/src/components/atoms/Buttons/Secondary/SecondaryButton.stories.tsx +84 -0
  208. package/src/components/atoms/Buttons/Secondary/SecondaryButton.test.tsx +39 -0
  209. package/src/components/atoms/Buttons/Secondary/SecondaryButton.tsx +14 -0
  210. package/src/components/atoms/Buttons/Secondary/SecondaryButtonWrapper.style.tsx +11 -0
  211. package/src/components/atoms/Buttons/Tertiary/TertiaryButton.stories.tsx +73 -0
  212. package/src/components/atoms/Buttons/Tertiary/TertiaryButton.style.tsx +29 -0
  213. package/src/components/atoms/Buttons/Tertiary/TertiaryButton.test.tsx +29 -0
  214. package/src/components/atoms/Buttons/Tertiary/TertiaryButton.tsx +18 -0
  215. package/src/components/atoms/Buttons/index.tsx +5 -0
  216. package/src/components/atoms/Dropdown/Dropdown.stories.tsx +153 -0
  217. package/src/components/atoms/Dropdown/Dropdown.style.tsx +64 -0
  218. package/src/components/atoms/Dropdown/Dropdown.test.tsx +67 -0
  219. package/src/components/atoms/Dropdown/Dropdown.tsx +131 -0
  220. package/src/components/atoms/Dropdown/index.tsx +3 -0
  221. package/src/components/atoms/Grid/Grid.stories.tsx +127 -0
  222. package/src/components/atoms/Grid/Grid.test.tsx +17 -0
  223. package/src/components/atoms/Grid/Grid.tsx +11 -0
  224. package/src/components/atoms/Grid/GridItem.test.tsx +25 -0
  225. package/src/components/atoms/Grid/GridItem.tsx +24 -0
  226. package/src/components/atoms/Grid/index.tsx +3 -0
  227. package/src/components/atoms/Heading/Heading.stories.tsx +44 -0
  228. package/src/components/atoms/Heading/Heading.style.tsx +14 -0
  229. package/src/components/atoms/Heading/Heading.test.tsx +13 -0
  230. package/src/components/atoms/Heading/Heading.tsx +15 -0
  231. package/src/components/atoms/Heading/index.tsx +3 -0
  232. package/src/components/atoms/Icons/Icons.stories.tsx +190 -0
  233. package/src/components/atoms/Icons/Icons.style.tsx +24 -0
  234. package/src/components/atoms/Icons/Icons.test.tsx +31 -0
  235. package/src/components/atoms/Icons/Icons.tsx +20 -0
  236. package/src/components/atoms/Icons/StorybookSupport/Iconography.tsx +27 -0
  237. package/src/components/atoms/Icons/StorybookSupport/IconsDiv.style.tsx +49 -0
  238. package/src/components/atoms/Icons/SvgIcons/12px/Remove.svg.tsx +11 -0
  239. package/src/components/atoms/Icons/SvgIcons/12px/Tick.svg.tsx +11 -0
  240. package/src/components/atoms/Icons/SvgIcons/Actions/AddToMyList.svg.tsx +13 -0
  241. package/src/components/atoms/Icons/SvgIcons/Actions/BookTickets.svg.tsx +20 -0
  242. package/src/components/atoms/Icons/SvgIcons/Actions/ChooseDates.svg.tsx +11 -0
  243. package/src/components/atoms/Icons/SvgIcons/Actions/EditMyList.svg.tsx +16 -0
  244. package/src/components/atoms/Icons/SvgIcons/Actions/Filter.svg.tsx +19 -0
  245. package/src/components/atoms/Icons/SvgIcons/Actions/FindAScreening.svg.tsx +31 -0
  246. package/src/components/atoms/Icons/SvgIcons/Actions/OnMyList.svg.tsx +16 -0
  247. package/src/components/atoms/Icons/SvgIcons/Actions/Reminder.svg.tsx +11 -0
  248. package/src/components/atoms/Icons/SvgIcons/Actions/Subscribe.svg.tsx +9 -0
  249. package/src/components/atoms/Icons/SvgIcons/Actions/Watch.svg.tsx +9 -0
  250. package/src/components/atoms/Icons/SvgIcons/Arrows/Arrow.svg.tsx +11 -0
  251. package/src/components/atoms/Icons/SvgIcons/Arrows/CarouselArrow.svg.tsx +11 -0
  252. package/src/components/atoms/Icons/SvgIcons/Arrows/DropdownArrow.svg.tsx +8 -0
  253. package/src/components/atoms/Icons/SvgIcons/Descriptors/Cinema.svg.tsx +31 -0
  254. package/src/components/atoms/Icons/SvgIcons/Descriptors/Clock.svg.tsx +15 -0
  255. package/src/components/atoms/Icons/SvgIcons/Descriptors/CreditCard.svg.tsx +19 -0
  256. package/src/components/atoms/Icons/SvgIcons/Descriptors/Email.svg.tsx +11 -0
  257. package/src/components/atoms/Icons/SvgIcons/Descriptors/Info.svg.tsx +13 -0
  258. package/src/components/atoms/Icons/SvgIcons/Descriptors/List.svg.tsx +22 -0
  259. package/src/components/atoms/Icons/SvgIcons/Descriptors/Location.svg.tsx +15 -0
  260. package/src/components/atoms/Icons/SvgIcons/Descriptors/PDF.svg.tsx +20 -0
  261. package/src/components/atoms/Icons/SvgIcons/Descriptors/Phone.svg.tsx +11 -0
  262. package/src/components/atoms/Icons/SvgIcons/Descriptors/Print.svg.tsx +11 -0
  263. package/src/components/atoms/Icons/SvgIcons/Descriptors/Secure.svg.tsx +15 -0
  264. package/src/components/atoms/Icons/SvgIcons/Descriptors/Tickets.svg.tsx +13 -0
  265. package/src/components/atoms/Icons/SvgIcons/Logos/Social/Facebook.svg.tsx +11 -0
  266. package/src/components/atoms/Icons/SvgIcons/Logos/Social/Instagram.svg.tsx +19 -0
  267. package/src/components/atoms/Icons/SvgIcons/Logos/Social/Tiktok.svg.tsx +11 -0
  268. package/src/components/atoms/Icons/SvgIcons/Logos/Social/Twitter.svg.tsx +11 -0
  269. package/src/components/atoms/Icons/SvgIcons/Logos/Social/Youtube.svg.tsx +11 -0
  270. package/src/components/atoms/Icons/SvgIcons/Logos/Sponsors/Sponsor.svg.tsx +26 -0
  271. package/src/components/atoms/Icons/SvgIcons/Navigation/BalletAndDance.svg.tsx +11 -0
  272. package/src/components/atoms/Icons/SvgIcons/Navigation/Basket.svg.tsx +11 -0
  273. package/src/components/atoms/Icons/SvgIcons/Navigation/BasketFull.svg.tsx +11 -0
  274. package/src/components/atoms/Icons/SvgIcons/Navigation/Home.svg.tsx +11 -0
  275. package/src/components/atoms/Icons/SvgIcons/Navigation/LiveStream.svg.tsx +24 -0
  276. package/src/components/atoms/Icons/SvgIcons/Navigation/Menu.svg.tsx +10 -0
  277. package/src/components/atoms/Icons/SvgIcons/Navigation/OperaAndMusic.svg.tsx +17 -0
  278. package/src/components/atoms/Icons/SvgIcons/Navigation/Search.svg.tsx +11 -0
  279. package/src/components/atoms/Icons/SvgIcons/Navigation/Settings.svg.tsx +15 -0
  280. package/src/components/atoms/Icons/SvgIcons/Navigation/User.svg.tsx +15 -0
  281. package/src/components/atoms/Icons/SvgIcons/Navigation/UserSignedIn.svg.tsx +12 -0
  282. package/src/components/atoms/Icons/SvgIcons/Text/Delete.svg.tsx +12 -0
  283. package/src/components/atoms/Icons/SvgIcons/Text/Shift.svg.tsx +8 -0
  284. package/src/components/atoms/Icons/SvgIcons/Text/Space.svg.tsx +8 -0
  285. package/src/components/atoms/Icons/SvgIcons/Utility/Close.svg.tsx +11 -0
  286. package/src/components/atoms/Icons/SvgIcons/Utility/Confirm.svg.tsx +8 -0
  287. package/src/components/atoms/Icons/SvgIcons/Utility/Detract.svg.tsx +8 -0
  288. package/src/components/atoms/Icons/SvgIcons/Utility/Expand.svg.tsx +8 -0
  289. package/src/components/atoms/Icons/SvgIcons/Utility/ExternalLink.svg.tsx +12 -0
  290. package/src/components/atoms/Icons/SvgIcons/Utility/GridView.svg.tsx +11 -0
  291. package/src/components/atoms/Icons/SvgIcons/Utility/ListView.svg.tsx +10 -0
  292. package/src/components/atoms/Icons/SvgIcons/Utility/Refresh.svg.tsx +15 -0
  293. package/src/components/atoms/Icons/SvgIcons/Video/AudioDescription.svg.tsx +16 -0
  294. package/src/components/atoms/Icons/SvgIcons/Video/Back10.svg.tsx +16 -0
  295. package/src/components/atoms/Icons/SvgIcons/Video/Clips.svg.tsx +10 -0
  296. package/src/components/atoms/Icons/SvgIcons/Video/Forward10.svg.tsx +16 -0
  297. package/src/components/atoms/Icons/SvgIcons/Video/FullScreen.svg.tsx +11 -0
  298. package/src/components/atoms/Icons/SvgIcons/Video/Minimise.svg.tsx +11 -0
  299. package/src/components/atoms/Icons/SvgIcons/Video/Muted.svg.tsx +15 -0
  300. package/src/components/atoms/Icons/SvgIcons/Video/Pause.svg.tsx +9 -0
  301. package/src/components/atoms/Icons/SvgIcons/Video/Play.svg.tsx +9 -0
  302. package/src/components/atoms/Icons/SvgIcons/Video/Restart.svg.tsx +11 -0
  303. package/src/components/atoms/Icons/SvgIcons/Video/Subtitles.svg.tsx +17 -0
  304. package/src/components/atoms/Icons/SvgIcons/Video/Trailer.svg.tsx +12 -0
  305. package/src/components/atoms/Icons/SvgIcons/Video/Volume.svg.tsx +19 -0
  306. package/src/components/atoms/Icons/SvgIcons/index.tsx +149 -0
  307. package/src/components/atoms/Icons/__snapshots__/Icons.test.tsx.snap +1954 -0
  308. package/src/components/atoms/Icons/index.tsx +2 -0
  309. package/src/components/atoms/Image/Image.tsx +72 -0
  310. package/src/components/atoms/ImageAspectRatioWrapper/ImageAspectRatio.test.tsx +23 -0
  311. package/src/components/atoms/ImageAspectRatioWrapper/ImageAspectRatioWrapper.stories.tsx +71 -0
  312. package/src/components/atoms/ImageAspectRatioWrapper/ImageAspectRatioWrapper.tsx +15 -0
  313. package/src/components/atoms/ImageAspectRatioWrapper/index.tsx +3 -0
  314. package/src/components/atoms/IndividualListing/IndividualListing.stories.tsx +51 -0
  315. package/src/components/atoms/IndividualListing/IndividualListing.style.tsx +33 -0
  316. package/src/components/atoms/IndividualListing/IndividualListing.test.tsx +30 -0
  317. package/src/components/atoms/IndividualListing/IndividualListing.tsx +22 -0
  318. package/src/components/atoms/IndividualListing/index.tsx +3 -0
  319. package/src/components/atoms/Logo/Logo.stories.tsx +48 -0
  320. package/src/components/atoms/Logo/Logo.style.tsx +18 -0
  321. package/src/components/atoms/Logo/Logo.tsx +30 -0
  322. package/src/components/atoms/Logo/index.tsx +3 -0
  323. package/src/components/atoms/Search/Search.stories.tsx +63 -0
  324. package/src/components/atoms/Search/Search.style.tsx +36 -0
  325. package/src/components/atoms/Search/Search.test.tsx +24 -0
  326. package/src/components/atoms/Search/Search.tsx +16 -0
  327. package/src/components/atoms/Search/index.tsx +3 -0
  328. package/src/components/atoms/SectionSplitter/SectionSplitter.stories.tsx +47 -0
  329. package/src/components/atoms/SectionSplitter/SectionSplitter.style.tsx +11 -0
  330. package/src/components/atoms/SectionSplitter/SectionSplitter.tsx +22 -0
  331. package/src/components/atoms/SectionSplitter/index.tsx +3 -0
  332. package/src/components/atoms/Sponsorship/Sponsorship.stories.tsx +38 -0
  333. package/src/components/atoms/Sponsorship/Sponsorship.test.tsx +36 -0
  334. package/src/components/atoms/Sponsorship/Sponsorship.tsx +53 -0
  335. package/src/components/atoms/Sponsorship/index.tsx +3 -0
  336. package/src/components/atoms/Tab/Tab.stories.tsx +67 -0
  337. package/src/components/atoms/Tab/Tab.style.tsx +105 -0
  338. package/src/components/atoms/Tab/Tab.test.tsx +28 -0
  339. package/src/components/atoms/Tab/Tab.tsx +34 -0
  340. package/src/components/atoms/Tab/index.tsx +3 -0
  341. package/src/components/atoms/TextLink/TextLink.stories.tsx +81 -0
  342. package/src/components/atoms/TextLink/TextLink.style.tsx +26 -0
  343. package/src/components/atoms/TextLink/TextLink.test.tsx +39 -0
  344. package/src/components/atoms/TextLink/TextLink.tsx +20 -0
  345. package/src/components/atoms/TextLink/index.tsx +3 -0
  346. package/src/components/atoms/TypeTags/TypeTags.stories.tsx +57 -0
  347. package/src/components/atoms/TypeTags/TypeTags.style.tsx +28 -0
  348. package/src/components/atoms/TypeTags/TypeTags.test.tsx +21 -0
  349. package/src/components/atoms/TypeTags/TypeTags.tsx +15 -0
  350. package/src/components/atoms/TypeTags/index.tsx +3 -0
  351. package/src/components/atoms/index.tsx +22 -0
  352. package/src/components/index.tsx +38 -0
  353. package/src/components/molecules/ContactNewsletter/ContactNewsletter.style.tsx +116 -0
  354. package/src/components/molecules/ContactNewsletter/ContactNewsletter.test.tsx +85 -0
  355. package/src/components/molecules/ContactNewsletter/ContactNewsletter.tsx +51 -0
  356. package/src/components/molecules/ContactNewsletter/index.tsx +3 -0
  357. package/src/components/molecules/Editorial/Editorial.stories.tsx +78 -0
  358. package/src/components/molecules/Editorial/Editorial.style.tsx +73 -0
  359. package/src/components/molecules/Editorial/Editorial.test.tsx +73 -0
  360. package/src/components/molecules/Editorial/Editorial.tsx +32 -0
  361. package/src/components/molecules/Editorial/index.tsx +3 -0
  362. package/src/components/molecules/NavTop/NavTop.stories.tsx +95 -0
  363. package/src/components/molecules/NavTop/NavTop.style.tsx +14 -0
  364. package/src/components/molecules/NavTop/NavTop.test.tsx +113 -0
  365. package/src/components/molecules/NavTop/NavTop.tsx +27 -0
  366. package/src/components/molecules/NavTop/index.tsx +3 -0
  367. package/src/components/molecules/PeopleListing/PeopleListing.stories.tsx +185 -0
  368. package/src/components/molecules/PeopleListing/PeopleListing.style.tsx +8 -0
  369. package/src/components/molecules/PeopleListing/PeopleListing.test.tsx +24 -0
  370. package/src/components/molecules/PeopleListing/PeopleListing.tsx +27 -0
  371. package/src/components/molecules/PeopleListing/index.tsx +3 -0
  372. package/src/components/molecules/PolicyLinks/PolicyLinks.style.tsx +41 -0
  373. package/src/components/molecules/PolicyLinks/PolicyLinks.test.tsx +28 -0
  374. package/src/components/molecules/PolicyLinks/PolicyLinks.tsx +19 -0
  375. package/src/components/molecules/PolicyLinks/index.tsx +3 -0
  376. package/src/components/molecules/PromoWithTitle/PromoWithTitle.stories.tsx +119 -0
  377. package/src/components/molecules/PromoWithTitle/PromoWithTitle.style.tsx +108 -0
  378. package/src/components/molecules/PromoWithTitle/PromoWithTitle.test.tsx +75 -0
  379. package/src/components/molecules/PromoWithTitle/PromoWithTitle.tsx +53 -0
  380. package/src/components/molecules/PromoWithTitle/index.tsx +3 -0
  381. package/src/components/molecules/SearchBar/SearchBar.stories.tsx +35 -0
  382. package/src/components/molecules/SearchBar/SearchBar.style.tsx +66 -0
  383. package/src/components/molecules/SearchBar/SearchBar.test.tsx +63 -0
  384. package/src/components/molecules/SearchBar/SearchBar.tsx +69 -0
  385. package/src/components/molecules/SearchBar/index.tsx +3 -0
  386. package/src/components/molecules/SectionTitle/SectionTitle.stories.tsx +68 -0
  387. package/src/components/molecules/SectionTitle/SectionTitle.style.tsx +34 -0
  388. package/src/components/molecules/SectionTitle/SectionTitle.test.tsx +35 -0
  389. package/src/components/molecules/SectionTitle/SectionTitle.tsx +25 -0
  390. package/src/components/molecules/SectionTitle/index.tsx +3 -0
  391. package/src/components/molecules/Tabs/Tabs.stories.tsx +101 -0
  392. package/src/components/molecules/Tabs/Tabs.style.tsx +74 -0
  393. package/src/components/molecules/Tabs/Tabs.test.tsx +149 -0
  394. package/src/components/molecules/Tabs/Tabs.tsx +67 -0
  395. package/src/components/molecules/Tabs/index.tsx +3 -0
  396. package/src/components/molecules/TextOnly/TextOnly.stories.tsx +74 -0
  397. package/src/components/molecules/TextOnly/TextOnly.style.tsx +56 -0
  398. package/src/components/molecules/TextOnly/TextOnly.test.tsx +79 -0
  399. package/src/components/molecules/TextOnly/TextOnly.tsx +16 -0
  400. package/src/components/molecules/TextOnly/index.tsx +3 -0
  401. package/src/components/molecules/index.tsx +7 -0
  402. package/src/components/organisms/Footer/Footer.stories.tsx +54 -0
  403. package/src/components/organisms/Footer/Footer.style.tsx +72 -0
  404. package/src/components/organisms/Footer/Footer.test.tsx +31 -0
  405. package/src/components/organisms/Footer/Footer.tsx +53 -0
  406. package/src/components/organisms/Footer/exampleData.json +78 -0
  407. package/src/components/organisms/Footer/index.tsx +3 -0
  408. package/src/components/organisms/Navigation/Navigation.stories.tsx +110 -0
  409. package/src/components/organisms/Navigation/Navigation.style.tsx +87 -0
  410. package/src/components/organisms/Navigation/Navigation.test.tsx +115 -0
  411. package/src/components/organisms/Navigation/Navigation.tsx +109 -0
  412. package/src/components/organisms/Navigation/index.tsx +3 -0
  413. package/src/components/organisms/Navigation/menuData.json +104 -0
  414. package/src/components/organisms/index.tsx +4 -0
  415. package/src/index.tsx +44 -0
  416. package/src/jest.setup.ts +1 -0
  417. package/src/styles/GlobalStyles.tsx +205 -0
  418. package/src/styles/StorybookSupport/Colours/Colours.stories.mdx +101 -0
  419. package/src/styles/StorybookSupport/Colours/StorybookColourBox.tsx +32 -0
  420. package/src/styles/ThemeProvider.tsx +11 -0
  421. package/src/styles/themes.ts +398 -0
  422. package/src/styles/viewports.ts +14 -0
  423. package/src/types/buttonTypes.ts +42 -0
  424. package/src/types/editorial.ts +84 -0
  425. package/src/types/footer.ts +49 -0
  426. package/src/types/iconTypes.ts +38 -0
  427. package/src/types/image.ts +13 -0
  428. package/src/types/images.d.ts +1 -0
  429. package/src/types/index.tsx +5 -0
  430. package/src/types/navigation.ts +149 -0
  431. package/src/types/types.ts +276 -0
@@ -0,0 +1,67 @@
1
+ import React from 'react';
2
+ import { render, fireEvent } from '@testing-library/react';
3
+ import Dropdown from './Dropdown';
4
+ import { IOptionItem } from '../../../types/types';
5
+
6
+ describe('Dropdown component', () => {
7
+ const onClick = jest.fn();
8
+
9
+ it('renders text with specific text', () => {
10
+ const title = 'TAB';
11
+ const options: IOptionItem[] = [
12
+ {
13
+ option: 'foo',
14
+ optionLink: 'bar',
15
+ },
16
+ ];
17
+ const onChange = onClick;
18
+
19
+ const { getByText } = render(<Dropdown title={title} options={options} onChange={onChange}></Dropdown>);
20
+
21
+ expect(getByText(title)).toBeInTheDocument();
22
+ });
23
+
24
+ it('calls onClick callback when text is clicked', () => {
25
+ const title = 'TAB';
26
+ const options: IOptionItem[] = [];
27
+ const onChange = onClick;
28
+
29
+ const { getByText } = render(<Dropdown title={title} options={options} onChange={onChange}></Dropdown>);
30
+ fireEvent.click(getByText('TAB'));
31
+
32
+ expect(onClick).toBeCalled();
33
+ });
34
+
35
+ it('renders options when click text', () => {
36
+ const title = 'TAB';
37
+ const options: IOptionItem[] = [
38
+ {
39
+ option: 'foo',
40
+ optionLink: 'bar',
41
+ },
42
+ ];
43
+ const onChange = onClick;
44
+
45
+ const { getByText } = render(<Dropdown title={title} options={options} onChange={onChange}></Dropdown>);
46
+ fireEvent.click(getByText('TAB'));
47
+
48
+ expect(getByText('foo')).toBeInTheDocument();
49
+ });
50
+
51
+ it('calls onClick callback when click text option', () => {
52
+ const title = 'TAB';
53
+ const options: IOptionItem[] = [
54
+ {
55
+ option: 'foo',
56
+ optionLink: 'bar',
57
+ },
58
+ ];
59
+ const onChange = onClick;
60
+
61
+ const { getByText } = render(<Dropdown title={title} options={options} onChange={onChange}></Dropdown>);
62
+ fireEvent.click(getByText('TAB'));
63
+ fireEvent.click(getByText('foo'));
64
+
65
+ expect(onClick).toBeCalled();
66
+ });
67
+ });
@@ -0,0 +1,131 @@
1
+ import React, { useEffect, useState, useRef } from 'react';
2
+ import { TabContainer, OptionsContainer, OptionItem } from './Dropdown.style';
3
+ import { IDropdownProps, INodeProps } from '../../../types/types';
4
+ import Tab from '../Tab';
5
+
6
+ const Dropdown = ({
7
+ title,
8
+ titleLink,
9
+ selected = false,
10
+ options = [],
11
+ onChange,
12
+ iconName = 'DropdownArrow',
13
+ isMobileBehaviour = false,
14
+ withOptionsInMobile = true,
15
+ withIcon = 'right',
16
+ }: IDropdownProps) => {
17
+ const node: INodeProps = useRef();
18
+ const [open, setOpen] = useState(false);
19
+ const [lockOpen, setLockOpen] = useState(false);
20
+ const [titleSelected, setTitleSelected] = useState(selected);
21
+ let timerCloseOptions: number;
22
+
23
+ useEffect(() => {
24
+ document.addEventListener('mousedown', handleClick);
25
+
26
+ return () => {
27
+ document.removeEventListener('mousedown', handleClick);
28
+ };
29
+ }, []);
30
+
31
+ const handleClick = (e: any) => {
32
+ if (node.current.contains(e.target)) {
33
+ return;
34
+ }
35
+
36
+ if (isMobileBehaviour) {
37
+ if (timerCloseOptions) {
38
+ clearTimeout(timerCloseOptions);
39
+ }
40
+
41
+ timerCloseOptions = setTimeout(() => {
42
+ setOpen(false);
43
+ setLockOpen(false);
44
+ setTitleSelected(false);
45
+ }, 200);
46
+ } else {
47
+ setOpen(false);
48
+ setLockOpen(false);
49
+ setTitleSelected(false);
50
+ }
51
+ };
52
+
53
+ const handleChange = (optionLink: string) => {
54
+ if (onChange) {
55
+ onChange(optionLink);
56
+ }
57
+
58
+ setOpen(false);
59
+ setLockOpen(false);
60
+ setTitleSelected(false);
61
+ };
62
+
63
+ const handleClickTitle = (value: string) => {
64
+ if (withOptions()) {
65
+ setLockOpen(true);
66
+ setOpen(true);
67
+ setTitleSelected(titleSelected);
68
+ }
69
+
70
+ if (onChange) {
71
+ onChange(value);
72
+ }
73
+ };
74
+
75
+ const onMouseHandler = (value: boolean) => {
76
+ if (withOptions() && !lockOpen) {
77
+ setOpen(value);
78
+ setTitleSelected(value);
79
+ }
80
+ };
81
+
82
+ const clickMobileHandler = () => {
83
+ if (withOptions()) {
84
+ setOpen(!open);
85
+ setTitleSelected(!open);
86
+ }
87
+ };
88
+
89
+ const renderTab = () => {
90
+ return (
91
+ <>
92
+ <Tab
93
+ title={title}
94
+ titleLink={titleLink}
95
+ selected={titleSelected}
96
+ iconName={iconName}
97
+ withIcon={withIcon}
98
+ withTextInMobile={withOptionsInMobile}
99
+ onClick={(value) => handleClickTitle(value)}
100
+ ></Tab>
101
+ {withOptions() && open && (
102
+ <OptionsContainer withOptionsInMobile={withOptionsInMobile} withIcon={withIcon}>
103
+ {options.map((optionItem, index) => (
104
+ <OptionItem key={`key-${index}-${optionItem.option}`} onClick={() => handleChange(optionItem.optionLink)}>
105
+ {optionItem.option}
106
+ </OptionItem>
107
+ ))}
108
+ </OptionsContainer>
109
+ )}
110
+ </>
111
+ );
112
+ };
113
+
114
+ const withOptions = () => options.length > 0;
115
+
116
+ return (
117
+ <>
118
+ {isMobileBehaviour ? (
119
+ <TabContainer ref={node} onClick={() => clickMobileHandler()}>
120
+ {renderTab()}
121
+ </TabContainer>
122
+ ) : (
123
+ <TabContainer ref={node} onMouseEnter={() => onMouseHandler(true)} onMouseLeave={() => onMouseHandler(false)}>
124
+ {renderTab()}
125
+ </TabContainer>
126
+ )}
127
+ </>
128
+ );
129
+ };
130
+
131
+ export default Dropdown;
@@ -0,0 +1,3 @@
1
+ import Dropdown from './Dropdown';
2
+
3
+ export default Dropdown;
@@ -0,0 +1,127 @@
1
+ import React from 'react';
2
+ import { Meta, Story } from '@storybook/react';
3
+ import { Grid, GridItem } from './index';
4
+ import GlobalStyles from '../../../styles/GlobalStyles';
5
+ import ThemeProvider from '../../../styles/ThemeProvider';
6
+ import { ThemeType } from '../../../types/types';
7
+
8
+ const meta: Meta = {
9
+ title: 'Foundations/Grid',
10
+ component: Grid,
11
+ argTypes: {
12
+ items: {
13
+ description:
14
+ 'The grid items need a __columnStart__ attribute and can have an optional __columnSpan__ attribute too. The _columnStart_ is the column in which to place it and the _columnSpan_ is the number of columns that the item should span. The default _columnSpan_ is 1.',
15
+ },
16
+ ref: {
17
+ table: { disable: true },
18
+ },
19
+ theme: {
20
+ table: { disable: true },
21
+ },
22
+ as: {
23
+ table: { disable: true },
24
+ },
25
+ forwardedAs: {
26
+ table: { disable: true },
27
+ },
28
+ },
29
+ decorators: [
30
+ (Story) => (
31
+ <ThemeProvider theme={ThemeType.Core}>
32
+ <GlobalStyles />
33
+ {Story()}
34
+ </ThemeProvider>
35
+ ),
36
+ ],
37
+ parameters: {
38
+ docs: {
39
+ description: {
40
+ component:
41
+ 'To have a full bleed responsive website, a grid is used. All site elements should be designed to this grid so they can be displayed and developed consistently. Using a grid also creates a consistent experience across multiple devices with different screen sizes.',
42
+ withSource: 'none',
43
+ },
44
+ },
45
+ design: {
46
+ type: 'figma',
47
+ url: 'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/ROH:-Design-System-and-Documentation?node-id=3%3A1497',
48
+ },
49
+ jest: ['Grid', 'GridItem'],
50
+ },
51
+ };
52
+
53
+ export default meta;
54
+ const Item = () => <div style={{ height: '3rem', backgroundColor: '#C8102E', opacity: '0.2' }} />;
55
+
56
+ interface IStorybookGridItem {
57
+ columnStartDesktop: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16;
58
+ columnSpanDesktop?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16;
59
+ columnStartDevice: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14;
60
+ columnSpanDevice?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14;
61
+ }
62
+
63
+ interface IStorybookGridItemProps {
64
+ items: IStorybookGridItem[];
65
+ }
66
+
67
+ const GridWithItemsTemplate: Story<IStorybookGridItemProps> = (args) => (
68
+ <Grid>
69
+ {args.items.map((i) => (
70
+ <GridItem
71
+ columnStartDesktop={i.columnStartDesktop}
72
+ columnSpanDesktop={i.columnSpanDesktop}
73
+ columnStartDevice={i.columnStartDevice}
74
+ columnSpanDevice={i.columnSpanDevice}
75
+ key={`key-${Math.random()}`}
76
+ >
77
+ <Item />
78
+ </GridItem>
79
+ ))}
80
+ </Grid>
81
+ );
82
+
83
+ export const GridWith12Items = GridWithItemsTemplate.bind({});
84
+ GridWith12Items.args = {
85
+ items: [
86
+ { columnStartDesktop: 3, columnSpanDesktop: 1, columnStartDevice: 2 },
87
+ { columnStartDesktop: 4, columnSpanDesktop: 1, columnStartDevice: 3 },
88
+ { columnStartDesktop: 5, columnSpanDesktop: 1, columnStartDevice: 4 },
89
+ { columnStartDesktop: 6, columnSpanDesktop: 1, columnStartDevice: 5 },
90
+ { columnStartDesktop: 7, columnSpanDesktop: 1, columnStartDevice: 6 },
91
+ { columnStartDesktop: 8, columnSpanDesktop: 1, columnStartDevice: 7 },
92
+ { columnStartDesktop: 9, columnSpanDesktop: 1, columnStartDevice: 8 },
93
+ { columnStartDesktop: 10, columnSpanDesktop: 1, columnStartDevice: 9 },
94
+ { columnStartDesktop: 11, columnSpanDesktop: 1, columnStartDevice: 10 },
95
+ { columnStartDesktop: 12, columnSpanDesktop: 1, columnStartDevice: 11 },
96
+ { columnStartDesktop: 13, columnSpanDesktop: 1, columnStartDevice: 12 },
97
+ { columnStartDesktop: 14, columnSpanDesktop: 1, columnStartDevice: 13 },
98
+ ],
99
+ };
100
+
101
+ export const GridWithColumnSpan = GridWithItemsTemplate.bind({});
102
+ GridWithColumnSpan.args = {
103
+ items: [
104
+ { columnStartDesktop: 3, columnSpanDesktop: 4, columnStartDevice: 2, columnSpanDevice: 4 },
105
+ { columnStartDesktop: 7, columnSpanDesktop: 1, columnStartDevice: 6, columnSpanDevice: 1 },
106
+ { columnStartDesktop: 8, columnSpanDesktop: 7, columnStartDevice: 7, columnSpanDevice: 7 },
107
+ ],
108
+ };
109
+
110
+ export const GridWithItemInMargin = GridWithItemsTemplate.bind({});
111
+ GridWithItemInMargin.args = {
112
+ items: [
113
+ { columnStartDesktop: 2, columnSpanDesktop: 1, columnStartDevice: 2, columnSpanDevice: 2 },
114
+ { columnStartDesktop: 3, columnSpanDesktop: 4, columnStartDevice: 4, columnSpanDevice: 3 },
115
+ { columnStartDesktop: 7, columnSpanDesktop: 1, columnStartDevice: 7, columnSpanDevice: 1 },
116
+ { columnStartDesktop: 8, columnSpanDesktop: 7, columnStartDevice: 8, columnSpanDevice: 6 },
117
+ ],
118
+ };
119
+
120
+ export const GridWithItemInOuterMargin = GridWithItemsTemplate.bind({});
121
+ GridWithItemInOuterMargin.args = {
122
+ items: [
123
+ { columnStartDesktop: 1, columnSpanDesktop: 7, columnStartDevice: 1, columnSpanDevice: 8 },
124
+ { columnStartDesktop: 8, columnSpanDesktop: 4, columnStartDevice: 9, columnSpanDevice: 3 },
125
+ { columnStartDesktop: 13, columnSpanDesktop: 1, columnStartDevice: 12, columnSpanDevice: 1 },
126
+ ],
127
+ };
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+ import Grid from './Grid';
4
+
5
+ describe('Grid component', () => {
6
+ it('sets proper styles related to a given theme', () => {
7
+ const { getByText } = render(<Grid>grid</Grid>);
8
+
9
+ expect(getByText('grid')).toHaveStyle({
10
+ display: 'grid',
11
+ 'grid-template-columns': 'var(--grid-template-columns)',
12
+ 'grid-template-rows': 'max-content',
13
+ gap: 'var(--grid-column-gap)',
14
+ margin: '0',
15
+ });
16
+ });
17
+ });
@@ -0,0 +1,11 @@
1
+ import styled from 'styled-components';
2
+
3
+ const Grid = styled.div`
4
+ display: grid;
5
+ grid-template-columns: var(--grid-template-columns);
6
+ grid-template-rows: max-content;
7
+ gap: var(--grid-column-gap);
8
+ margin: 0;
9
+ `;
10
+
11
+ export default Grid;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+ import GridItem from './GridItem';
4
+
5
+ describe('GridItem component', () => {
6
+ it('sets proper styles when columnSpan is ommited', () => {
7
+ const { getByText } = render(<GridItem columnStartDesktop={2}>gridItem</GridItem>);
8
+
9
+ expect(getByText('gridItem')).toHaveStyle({
10
+ 'grid-column': '2 / span 1',
11
+ });
12
+ });
13
+
14
+ it('sets proper styles when columnSpan is provided', () => {
15
+ const { getByText } = render(
16
+ <GridItem columnStartDesktop={1} columnSpanDesktop={3}>
17
+ gridItem
18
+ </GridItem>
19
+ );
20
+
21
+ expect(getByText('gridItem')).toHaveStyle({
22
+ 'grid-column': '1 / span 3',
23
+ });
24
+ });
25
+ });
@@ -0,0 +1,24 @@
1
+ import styled from 'styled-components';
2
+ import { devices } from '../../../styles/viewports';
3
+ import { IGridItemProps } from '../../../types/types';
4
+
5
+ const GridItem = styled.div<IGridItemProps>`
6
+ grid-column: ${({ columnStartDesktop }) => columnStartDesktop} / span
7
+ ${({ columnSpanDesktop = 1 }) => columnSpanDesktop};
8
+
9
+ @media ${devices.mobile} {
10
+ & {
11
+ grid-column: ${({ columnStartDevice }) => columnStartDevice} / span
12
+ ${({ columnSpanDevice = 1 }) => columnSpanDevice};
13
+ }
14
+ }
15
+
16
+ @media ${devices.tablet} {
17
+ & {
18
+ grid-column: ${({ columnStartDevice }) => columnStartDevice} / span
19
+ ${({ columnSpanDevice = 1 }) => columnSpanDevice};
20
+ }
21
+ }
22
+ `;
23
+
24
+ export default GridItem;
@@ -0,0 +1,3 @@
1
+ import Grid from './Grid';
2
+ import GridItem from './GridItem';
3
+ export { Grid, GridItem };
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { Meta, Story } from '@storybook/react';
3
+ import HeadingComponent from './Heading';
4
+ import GlobalStyles from '../../../styles/GlobalStyles';
5
+ import ThemeProvider from '../../../styles/ThemeProvider';
6
+ import { IHeadingProps, ThemeType } from '../../../types/types';
7
+
8
+ const meta: Meta = {
9
+ title: 'Foundations/Typography',
10
+ component: HeadingComponent,
11
+ argTypes: {
12
+ level: {
13
+ options: [1, 2, 3, 4, 5, 6],
14
+ control: { type: 'select' },
15
+ },
16
+ children: {
17
+ control: {
18
+ type: 'text',
19
+ },
20
+ },
21
+ },
22
+ parameters: {
23
+ controls: { expanded: true },
24
+ jest: ['Heading'],
25
+ },
26
+ decorators: [
27
+ (Story) => (
28
+ <ThemeProvider theme={ThemeType.Core}>
29
+ <GlobalStyles />
30
+ <Story />
31
+ </ThemeProvider>
32
+ ),
33
+ ],
34
+ };
35
+
36
+ export default meta;
37
+
38
+ const HeadingTemplate: Story<IHeadingProps> = (args) => <HeadingComponent {...args} />;
39
+ export const Heading = HeadingTemplate.bind({});
40
+
41
+ Heading.args = {
42
+ level: 1,
43
+ children: 'Heading',
44
+ };
@@ -0,0 +1,14 @@
1
+ import styled from 'styled-components';
2
+ import { IHeadingWrapperProps } from '../../../types/types';
3
+
4
+ const HeaderWrapper = styled.h1<IHeadingWrapperProps>`
5
+ font-size: var(--font-size-header-${({ level }) => level});
6
+ font-family: var(--font-family-header);
7
+ font-weight: var(--font-weight-header-${({ level }) => level});
8
+ letter-spacing: var(--letter-spacing-header-${({ level }) => level});
9
+ line-height: var(--line-height-header-${({ level }) => level});
10
+ text-transform: uppercase;
11
+ word-break: break-word;
12
+ `;
13
+
14
+ export default HeaderWrapper;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+ import Heading from './Heading';
4
+ import { HeadingLevel } from '../../../types/types';
5
+
6
+ describe('Heading component', () => {
7
+ it('renders html headers', () => {
8
+ const text = 'Test Heading';
9
+ const { getByText } = render(<Heading level={HeadingLevel.H3}>{text}</Heading>);
10
+
11
+ expect(getByText(text)).toBeInTheDocument();
12
+ });
13
+ });
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import HeadingWrapper from './Heading.style';
3
+ import { IHeadingProps } from '../../../types/types';
4
+
5
+ const Heading = ({ level, children }: IHeadingProps) => {
6
+ const tag = `h${level}` as React.ElementType;
7
+
8
+ return (
9
+ <HeadingWrapper as={tag} level={level}>
10
+ {children}
11
+ </HeadingWrapper>
12
+ );
13
+ };
14
+
15
+ export default Heading;
@@ -0,0 +1,3 @@
1
+ import Heading from './Heading';
2
+
3
+ export default Heading;