@royaloperahouse/chord 0.1.0 → 0.3.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 (272) hide show
  1. package/README.md +9 -0
  2. package/dist/chord.cjs.development.js +567 -278
  3. package/dist/chord.cjs.development.js.map +1 -1
  4. package/dist/chord.cjs.production.min.js +1 -1
  5. package/dist/chord.cjs.production.min.js.map +1 -1
  6. package/dist/chord.esm.js +567 -279
  7. package/dist/chord.esm.js.map +1 -1
  8. package/dist/components/atoms/Account/Account.d.ts +1 -1
  9. package/dist/components/atoms/Basket/Basket.d.ts +1 -1
  10. package/dist/components/atoms/Dropdown/Dropdown.d.ts +1 -1
  11. package/dist/components/atoms/Dropdown/Dropdown.style.d.ts +1 -1
  12. package/dist/components/atoms/Icons/SvgIcons/index.d.ts +0 -1
  13. package/dist/components/atoms/Logo/Logo.d.ts +1 -1
  14. package/dist/components/atoms/Search/Search.d.ts +1 -1
  15. package/dist/components/atoms/SponsorLogo/SponsorLogo.d.ts +4 -0
  16. package/dist/components/atoms/SponsorLogo/SponsorLogo.style.d.ts +1 -0
  17. package/dist/components/atoms/SponsorLogo/index.d.ts +2 -0
  18. package/dist/components/atoms/Tab/Tab.d.ts +1 -1
  19. package/dist/components/atoms/index.d.ts +2 -1
  20. package/dist/components/molecules/NavTop/NavTop.d.ts +1 -1
  21. package/dist/components/molecules/Tabs/Tabs.d.ts +1 -1
  22. package/dist/components/molecules/Tabs/Tabs.style.d.ts +1 -1
  23. package/dist/components/organisms/Navigation/Navigation.d.ts +1 -1
  24. package/dist/index.d.ts +2 -2
  25. package/dist/styles/themes.d.ts +6 -0
  26. package/dist/types/navigation.d.ts +24 -0
  27. package/dist/types/types.d.ts +24 -2
  28. package/package.json +10 -6
  29. package/dist/components/atoms/Icons/SvgIcons/Logos/Sponsors/Sponsor.svg.d.ts +0 -4
  30. package/dist/components/atoms/Image/Image.d.ts +0 -38
  31. package/src/components/atoms/Account/Account.stories.tsx +0 -93
  32. package/src/components/atoms/Account/Account.test.tsx +0 -54
  33. package/src/components/atoms/Account/Account.tsx +0 -25
  34. package/src/components/atoms/Account/index.tsx +0 -3
  35. package/src/components/atoms/Basket/Basket.stories.tsx +0 -79
  36. package/src/components/atoms/Basket/Basket.style.tsx +0 -74
  37. package/src/components/atoms/Basket/Basket.test.tsx +0 -35
  38. package/src/components/atoms/Basket/Basket.tsx +0 -34
  39. package/src/components/atoms/Basket/index.tsx +0 -3
  40. package/src/components/atoms/Buttons/Button.style.tsx +0 -31
  41. package/src/components/atoms/Buttons/Button.tsx +0 -21
  42. package/src/components/atoms/Buttons/ButtonIconWrapper.style.tsx +0 -10
  43. package/src/components/atoms/Buttons/Buttons.stories.tsx +0 -77
  44. package/src/components/atoms/Buttons/Primary/PrimaryButton.stories.tsx +0 -94
  45. package/src/components/atoms/Buttons/Primary/PrimaryButton.test.tsx +0 -39
  46. package/src/components/atoms/Buttons/Primary/PrimaryButton.tsx +0 -14
  47. package/src/components/atoms/Buttons/Primary/PrimaryButtonWrapper.style.tsx +0 -11
  48. package/src/components/atoms/Buttons/Secondary/SecondaryButton.stories.tsx +0 -84
  49. package/src/components/atoms/Buttons/Secondary/SecondaryButton.test.tsx +0 -39
  50. package/src/components/atoms/Buttons/Secondary/SecondaryButton.tsx +0 -14
  51. package/src/components/atoms/Buttons/Secondary/SecondaryButtonWrapper.style.tsx +0 -11
  52. package/src/components/atoms/Buttons/Tertiary/TertiaryButton.stories.tsx +0 -73
  53. package/src/components/atoms/Buttons/Tertiary/TertiaryButton.style.tsx +0 -29
  54. package/src/components/atoms/Buttons/Tertiary/TertiaryButton.test.tsx +0 -29
  55. package/src/components/atoms/Buttons/Tertiary/TertiaryButton.tsx +0 -18
  56. package/src/components/atoms/Buttons/index.tsx +0 -5
  57. package/src/components/atoms/Dropdown/Dropdown.stories.tsx +0 -153
  58. package/src/components/atoms/Dropdown/Dropdown.style.tsx +0 -64
  59. package/src/components/atoms/Dropdown/Dropdown.test.tsx +0 -67
  60. package/src/components/atoms/Dropdown/Dropdown.tsx +0 -131
  61. package/src/components/atoms/Dropdown/index.tsx +0 -3
  62. package/src/components/atoms/Grid/Grid.stories.tsx +0 -127
  63. package/src/components/atoms/Grid/Grid.test.tsx +0 -17
  64. package/src/components/atoms/Grid/Grid.tsx +0 -11
  65. package/src/components/atoms/Grid/GridItem.test.tsx +0 -25
  66. package/src/components/atoms/Grid/GridItem.tsx +0 -24
  67. package/src/components/atoms/Grid/index.tsx +0 -3
  68. package/src/components/atoms/Heading/Heading.stories.tsx +0 -44
  69. package/src/components/atoms/Heading/Heading.style.tsx +0 -14
  70. package/src/components/atoms/Heading/Heading.test.tsx +0 -13
  71. package/src/components/atoms/Heading/Heading.tsx +0 -15
  72. package/src/components/atoms/Heading/index.tsx +0 -3
  73. package/src/components/atoms/Icons/Icons.stories.tsx +0 -190
  74. package/src/components/atoms/Icons/Icons.style.tsx +0 -24
  75. package/src/components/atoms/Icons/Icons.test.tsx +0 -31
  76. package/src/components/atoms/Icons/Icons.tsx +0 -20
  77. package/src/components/atoms/Icons/StorybookSupport/Iconography.tsx +0 -27
  78. package/src/components/atoms/Icons/StorybookSupport/IconsDiv.style.tsx +0 -49
  79. package/src/components/atoms/Icons/SvgIcons/12px/Remove.svg.tsx +0 -11
  80. package/src/components/atoms/Icons/SvgIcons/12px/Tick.svg.tsx +0 -11
  81. package/src/components/atoms/Icons/SvgIcons/Actions/AddToMyList.svg.tsx +0 -13
  82. package/src/components/atoms/Icons/SvgIcons/Actions/BookTickets.svg.tsx +0 -20
  83. package/src/components/atoms/Icons/SvgIcons/Actions/ChooseDates.svg.tsx +0 -11
  84. package/src/components/atoms/Icons/SvgIcons/Actions/EditMyList.svg.tsx +0 -16
  85. package/src/components/atoms/Icons/SvgIcons/Actions/Filter.svg.tsx +0 -19
  86. package/src/components/atoms/Icons/SvgIcons/Actions/FindAScreening.svg.tsx +0 -31
  87. package/src/components/atoms/Icons/SvgIcons/Actions/OnMyList.svg.tsx +0 -16
  88. package/src/components/atoms/Icons/SvgIcons/Actions/Reminder.svg.tsx +0 -11
  89. package/src/components/atoms/Icons/SvgIcons/Actions/Subscribe.svg.tsx +0 -9
  90. package/src/components/atoms/Icons/SvgIcons/Actions/Watch.svg.tsx +0 -9
  91. package/src/components/atoms/Icons/SvgIcons/Arrows/Arrow.svg.tsx +0 -11
  92. package/src/components/atoms/Icons/SvgIcons/Arrows/CarouselArrow.svg.tsx +0 -11
  93. package/src/components/atoms/Icons/SvgIcons/Arrows/DropdownArrow.svg.tsx +0 -8
  94. package/src/components/atoms/Icons/SvgIcons/Descriptors/Cinema.svg.tsx +0 -31
  95. package/src/components/atoms/Icons/SvgIcons/Descriptors/Clock.svg.tsx +0 -15
  96. package/src/components/atoms/Icons/SvgIcons/Descriptors/CreditCard.svg.tsx +0 -19
  97. package/src/components/atoms/Icons/SvgIcons/Descriptors/Email.svg.tsx +0 -11
  98. package/src/components/atoms/Icons/SvgIcons/Descriptors/Info.svg.tsx +0 -13
  99. package/src/components/atoms/Icons/SvgIcons/Descriptors/List.svg.tsx +0 -22
  100. package/src/components/atoms/Icons/SvgIcons/Descriptors/Location.svg.tsx +0 -15
  101. package/src/components/atoms/Icons/SvgIcons/Descriptors/PDF.svg.tsx +0 -20
  102. package/src/components/atoms/Icons/SvgIcons/Descriptors/Phone.svg.tsx +0 -11
  103. package/src/components/atoms/Icons/SvgIcons/Descriptors/Print.svg.tsx +0 -11
  104. package/src/components/atoms/Icons/SvgIcons/Descriptors/Secure.svg.tsx +0 -15
  105. package/src/components/atoms/Icons/SvgIcons/Descriptors/Tickets.svg.tsx +0 -13
  106. package/src/components/atoms/Icons/SvgIcons/Logos/Social/Facebook.svg.tsx +0 -11
  107. package/src/components/atoms/Icons/SvgIcons/Logos/Social/Instagram.svg.tsx +0 -19
  108. package/src/components/atoms/Icons/SvgIcons/Logos/Social/Tiktok.svg.tsx +0 -11
  109. package/src/components/atoms/Icons/SvgIcons/Logos/Social/Twitter.svg.tsx +0 -11
  110. package/src/components/atoms/Icons/SvgIcons/Logos/Social/Youtube.svg.tsx +0 -11
  111. package/src/components/atoms/Icons/SvgIcons/Logos/Sponsors/Sponsor.svg.tsx +0 -26
  112. package/src/components/atoms/Icons/SvgIcons/Navigation/BalletAndDance.svg.tsx +0 -11
  113. package/src/components/atoms/Icons/SvgIcons/Navigation/Basket.svg.tsx +0 -11
  114. package/src/components/atoms/Icons/SvgIcons/Navigation/BasketFull.svg.tsx +0 -11
  115. package/src/components/atoms/Icons/SvgIcons/Navigation/Home.svg.tsx +0 -11
  116. package/src/components/atoms/Icons/SvgIcons/Navigation/LiveStream.svg.tsx +0 -24
  117. package/src/components/atoms/Icons/SvgIcons/Navigation/Menu.svg.tsx +0 -10
  118. package/src/components/atoms/Icons/SvgIcons/Navigation/OperaAndMusic.svg.tsx +0 -17
  119. package/src/components/atoms/Icons/SvgIcons/Navigation/Search.svg.tsx +0 -11
  120. package/src/components/atoms/Icons/SvgIcons/Navigation/Settings.svg.tsx +0 -15
  121. package/src/components/atoms/Icons/SvgIcons/Navigation/User.svg.tsx +0 -15
  122. package/src/components/atoms/Icons/SvgIcons/Navigation/UserSignedIn.svg.tsx +0 -12
  123. package/src/components/atoms/Icons/SvgIcons/Text/Delete.svg.tsx +0 -12
  124. package/src/components/atoms/Icons/SvgIcons/Text/Shift.svg.tsx +0 -8
  125. package/src/components/atoms/Icons/SvgIcons/Text/Space.svg.tsx +0 -8
  126. package/src/components/atoms/Icons/SvgIcons/Utility/Close.svg.tsx +0 -11
  127. package/src/components/atoms/Icons/SvgIcons/Utility/Confirm.svg.tsx +0 -8
  128. package/src/components/atoms/Icons/SvgIcons/Utility/Detract.svg.tsx +0 -8
  129. package/src/components/atoms/Icons/SvgIcons/Utility/Expand.svg.tsx +0 -8
  130. package/src/components/atoms/Icons/SvgIcons/Utility/ExternalLink.svg.tsx +0 -12
  131. package/src/components/atoms/Icons/SvgIcons/Utility/GridView.svg.tsx +0 -11
  132. package/src/components/atoms/Icons/SvgIcons/Utility/ListView.svg.tsx +0 -10
  133. package/src/components/atoms/Icons/SvgIcons/Utility/Refresh.svg.tsx +0 -15
  134. package/src/components/atoms/Icons/SvgIcons/Video/AudioDescription.svg.tsx +0 -16
  135. package/src/components/atoms/Icons/SvgIcons/Video/Back10.svg.tsx +0 -16
  136. package/src/components/atoms/Icons/SvgIcons/Video/Clips.svg.tsx +0 -10
  137. package/src/components/atoms/Icons/SvgIcons/Video/Forward10.svg.tsx +0 -16
  138. package/src/components/atoms/Icons/SvgIcons/Video/FullScreen.svg.tsx +0 -11
  139. package/src/components/atoms/Icons/SvgIcons/Video/Minimise.svg.tsx +0 -11
  140. package/src/components/atoms/Icons/SvgIcons/Video/Muted.svg.tsx +0 -15
  141. package/src/components/atoms/Icons/SvgIcons/Video/Pause.svg.tsx +0 -9
  142. package/src/components/atoms/Icons/SvgIcons/Video/Play.svg.tsx +0 -9
  143. package/src/components/atoms/Icons/SvgIcons/Video/Restart.svg.tsx +0 -11
  144. package/src/components/atoms/Icons/SvgIcons/Video/Subtitles.svg.tsx +0 -17
  145. package/src/components/atoms/Icons/SvgIcons/Video/Trailer.svg.tsx +0 -12
  146. package/src/components/atoms/Icons/SvgIcons/Video/Volume.svg.tsx +0 -19
  147. package/src/components/atoms/Icons/SvgIcons/index.tsx +0 -149
  148. package/src/components/atoms/Icons/__snapshots__/Icons.test.tsx.snap +0 -1954
  149. package/src/components/atoms/Icons/index.tsx +0 -2
  150. package/src/components/atoms/Image/Image.tsx +0 -72
  151. package/src/components/atoms/ImageAspectRatioWrapper/ImageAspectRatio.test.tsx +0 -23
  152. package/src/components/atoms/ImageAspectRatioWrapper/ImageAspectRatioWrapper.stories.tsx +0 -71
  153. package/src/components/atoms/ImageAspectRatioWrapper/ImageAspectRatioWrapper.tsx +0 -15
  154. package/src/components/atoms/ImageAspectRatioWrapper/index.tsx +0 -3
  155. package/src/components/atoms/IndividualListing/IndividualListing.stories.tsx +0 -51
  156. package/src/components/atoms/IndividualListing/IndividualListing.style.tsx +0 -33
  157. package/src/components/atoms/IndividualListing/IndividualListing.test.tsx +0 -30
  158. package/src/components/atoms/IndividualListing/IndividualListing.tsx +0 -22
  159. package/src/components/atoms/IndividualListing/index.tsx +0 -3
  160. package/src/components/atoms/Logo/Logo.stories.tsx +0 -48
  161. package/src/components/atoms/Logo/Logo.style.tsx +0 -18
  162. package/src/components/atoms/Logo/Logo.tsx +0 -30
  163. package/src/components/atoms/Logo/index.tsx +0 -3
  164. package/src/components/atoms/Search/Search.stories.tsx +0 -63
  165. package/src/components/atoms/Search/Search.style.tsx +0 -36
  166. package/src/components/atoms/Search/Search.test.tsx +0 -24
  167. package/src/components/atoms/Search/Search.tsx +0 -16
  168. package/src/components/atoms/Search/index.tsx +0 -3
  169. package/src/components/atoms/SectionSplitter/SectionSplitter.stories.tsx +0 -47
  170. package/src/components/atoms/SectionSplitter/SectionSplitter.style.tsx +0 -11
  171. package/src/components/atoms/SectionSplitter/SectionSplitter.tsx +0 -22
  172. package/src/components/atoms/SectionSplitter/index.tsx +0 -3
  173. package/src/components/atoms/Sponsorship/Sponsorship.stories.tsx +0 -38
  174. package/src/components/atoms/Sponsorship/Sponsorship.test.tsx +0 -36
  175. package/src/components/atoms/Sponsorship/Sponsorship.tsx +0 -53
  176. package/src/components/atoms/Sponsorship/index.tsx +0 -3
  177. package/src/components/atoms/Tab/Tab.stories.tsx +0 -67
  178. package/src/components/atoms/Tab/Tab.style.tsx +0 -105
  179. package/src/components/atoms/Tab/Tab.test.tsx +0 -28
  180. package/src/components/atoms/Tab/Tab.tsx +0 -34
  181. package/src/components/atoms/Tab/index.tsx +0 -3
  182. package/src/components/atoms/TextLink/TextLink.stories.tsx +0 -81
  183. package/src/components/atoms/TextLink/TextLink.style.tsx +0 -26
  184. package/src/components/atoms/TextLink/TextLink.test.tsx +0 -39
  185. package/src/components/atoms/TextLink/TextLink.tsx +0 -20
  186. package/src/components/atoms/TextLink/index.tsx +0 -3
  187. package/src/components/atoms/TypeTags/TypeTags.stories.tsx +0 -57
  188. package/src/components/atoms/TypeTags/TypeTags.style.tsx +0 -28
  189. package/src/components/atoms/TypeTags/TypeTags.test.tsx +0 -21
  190. package/src/components/atoms/TypeTags/TypeTags.tsx +0 -15
  191. package/src/components/atoms/TypeTags/index.tsx +0 -3
  192. package/src/components/atoms/index.tsx +0 -22
  193. package/src/components/index.tsx +0 -38
  194. package/src/components/molecules/ContactNewsletter/ContactNewsletter.style.tsx +0 -116
  195. package/src/components/molecules/ContactNewsletter/ContactNewsletter.test.tsx +0 -85
  196. package/src/components/molecules/ContactNewsletter/ContactNewsletter.tsx +0 -51
  197. package/src/components/molecules/ContactNewsletter/index.tsx +0 -3
  198. package/src/components/molecules/Editorial/Editorial.stories.tsx +0 -78
  199. package/src/components/molecules/Editorial/Editorial.style.tsx +0 -73
  200. package/src/components/molecules/Editorial/Editorial.test.tsx +0 -73
  201. package/src/components/molecules/Editorial/Editorial.tsx +0 -32
  202. package/src/components/molecules/Editorial/index.tsx +0 -3
  203. package/src/components/molecules/NavTop/NavTop.stories.tsx +0 -95
  204. package/src/components/molecules/NavTop/NavTop.style.tsx +0 -14
  205. package/src/components/molecules/NavTop/NavTop.test.tsx +0 -113
  206. package/src/components/molecules/NavTop/NavTop.tsx +0 -27
  207. package/src/components/molecules/NavTop/index.tsx +0 -3
  208. package/src/components/molecules/PeopleListing/PeopleListing.stories.tsx +0 -185
  209. package/src/components/molecules/PeopleListing/PeopleListing.style.tsx +0 -8
  210. package/src/components/molecules/PeopleListing/PeopleListing.test.tsx +0 -24
  211. package/src/components/molecules/PeopleListing/PeopleListing.tsx +0 -27
  212. package/src/components/molecules/PeopleListing/index.tsx +0 -3
  213. package/src/components/molecules/PolicyLinks/PolicyLinks.style.tsx +0 -41
  214. package/src/components/molecules/PolicyLinks/PolicyLinks.test.tsx +0 -28
  215. package/src/components/molecules/PolicyLinks/PolicyLinks.tsx +0 -19
  216. package/src/components/molecules/PolicyLinks/index.tsx +0 -3
  217. package/src/components/molecules/PromoWithTitle/PromoWithTitle.stories.tsx +0 -119
  218. package/src/components/molecules/PromoWithTitle/PromoWithTitle.style.tsx +0 -108
  219. package/src/components/molecules/PromoWithTitle/PromoWithTitle.test.tsx +0 -75
  220. package/src/components/molecules/PromoWithTitle/PromoWithTitle.tsx +0 -53
  221. package/src/components/molecules/PromoWithTitle/index.tsx +0 -3
  222. package/src/components/molecules/SearchBar/SearchBar.stories.tsx +0 -35
  223. package/src/components/molecules/SearchBar/SearchBar.style.tsx +0 -66
  224. package/src/components/molecules/SearchBar/SearchBar.test.tsx +0 -63
  225. package/src/components/molecules/SearchBar/SearchBar.tsx +0 -69
  226. package/src/components/molecules/SearchBar/index.tsx +0 -3
  227. package/src/components/molecules/SectionTitle/SectionTitle.stories.tsx +0 -68
  228. package/src/components/molecules/SectionTitle/SectionTitle.style.tsx +0 -34
  229. package/src/components/molecules/SectionTitle/SectionTitle.test.tsx +0 -35
  230. package/src/components/molecules/SectionTitle/SectionTitle.tsx +0 -25
  231. package/src/components/molecules/SectionTitle/index.tsx +0 -3
  232. package/src/components/molecules/Tabs/Tabs.stories.tsx +0 -101
  233. package/src/components/molecules/Tabs/Tabs.style.tsx +0 -74
  234. package/src/components/molecules/Tabs/Tabs.test.tsx +0 -149
  235. package/src/components/molecules/Tabs/Tabs.tsx +0 -67
  236. package/src/components/molecules/Tabs/index.tsx +0 -3
  237. package/src/components/molecules/TextOnly/TextOnly.stories.tsx +0 -74
  238. package/src/components/molecules/TextOnly/TextOnly.style.tsx +0 -56
  239. package/src/components/molecules/TextOnly/TextOnly.test.tsx +0 -79
  240. package/src/components/molecules/TextOnly/TextOnly.tsx +0 -16
  241. package/src/components/molecules/TextOnly/index.tsx +0 -3
  242. package/src/components/molecules/index.tsx +0 -7
  243. package/src/components/organisms/Footer/Footer.stories.tsx +0 -54
  244. package/src/components/organisms/Footer/Footer.style.tsx +0 -72
  245. package/src/components/organisms/Footer/Footer.test.tsx +0 -31
  246. package/src/components/organisms/Footer/Footer.tsx +0 -53
  247. package/src/components/organisms/Footer/exampleData.json +0 -78
  248. package/src/components/organisms/Footer/index.tsx +0 -3
  249. package/src/components/organisms/Navigation/Navigation.stories.tsx +0 -110
  250. package/src/components/organisms/Navigation/Navigation.style.tsx +0 -87
  251. package/src/components/organisms/Navigation/Navigation.test.tsx +0 -115
  252. package/src/components/organisms/Navigation/Navigation.tsx +0 -109
  253. package/src/components/organisms/Navigation/index.tsx +0 -3
  254. package/src/components/organisms/Navigation/menuData.json +0 -104
  255. package/src/components/organisms/index.tsx +0 -4
  256. package/src/index.tsx +0 -44
  257. package/src/jest.setup.ts +0 -1
  258. package/src/styles/GlobalStyles.tsx +0 -205
  259. package/src/styles/StorybookSupport/Colours/Colours.stories.mdx +0 -101
  260. package/src/styles/StorybookSupport/Colours/StorybookColourBox.tsx +0 -32
  261. package/src/styles/ThemeProvider.tsx +0 -11
  262. package/src/styles/themes.ts +0 -398
  263. package/src/styles/viewports.ts +0 -14
  264. package/src/types/buttonTypes.ts +0 -42
  265. package/src/types/editorial.ts +0 -84
  266. package/src/types/footer.ts +0 -49
  267. package/src/types/iconTypes.ts +0 -38
  268. package/src/types/image.ts +0 -13
  269. package/src/types/images.d.ts +0 -1
  270. package/src/types/index.tsx +0 -5
  271. package/src/types/navigation.ts +0 -149
  272. package/src/types/types.ts +0 -276
@@ -1,2 +0,0 @@
1
- export { default as Icon } from './Icons';
2
- export * from './Icons';
@@ -1,72 +0,0 @@
1
- import React, { FunctionComponent } from 'react';
2
- import styled from 'styled-components';
3
- import { devices } from '../../../styles/viewports';
4
-
5
- const DEFAULT_ERROR_IMAGE_SRC = '';
6
-
7
- export const AspectRatioDefinitions = {
8
- '4:3': { height: '', width: '100%' },
9
- '3:4': { height: '', width: '100%' },
10
- '16:9': { height: '', width: '100%' },
11
- '1:1': { height: '', width: '100%' },
12
- };
13
-
14
- interface AspectRatioCSSSpecs {
15
- height: string;
16
- width: string;
17
- }
18
-
19
- export type AspectRatioType = keyof typeof AspectRatioDefinitions;
20
-
21
- export interface IImageProps {
22
- desktopSrc: string;
23
- mobileSrc?: string;
24
- aspectRatio: AspectRatioType;
25
- altText?: string;
26
- errorImageSrc?: string;
27
- }
28
-
29
- export interface IStyledImageProps {
30
- srcSet: string;
31
- sizes: string;
32
- aspectRatio: AspectRatioCSSSpecs;
33
- }
34
-
35
- const ImageStyled = styled.img<IStyledImageProps>`
36
- border: none;
37
- width: ${({ aspectRatio }) => aspectRatio.width}
38
- height: ${({ aspectRatio }) => aspectRatio.height}
39
- @media ${devices.mobile} {
40
- width: 60px;
41
- height: 60px;
42
- }
43
- `;
44
-
45
- const onErrorHandlerGenerator = (errorImageSrc: string) => (event: React.SyntheticEvent<HTMLImageElement, Event>) => {
46
- const targetImage = event.target as HTMLImageElement;
47
- targetImage.onerror = () => {};
48
- targetImage.src = errorImageSrc;
49
- };
50
-
51
- const Image: FunctionComponent<IImageProps> = ({
52
- desktopSrc,
53
- mobileSrc,
54
- aspectRatio,
55
- altText,
56
- errorImageSrc = DEFAULT_ERROR_IMAGE_SRC,
57
- }) => {
58
- const srcSet = mobileSrc ? `${desktopSrc} 200w, ${mobileSrc} 400w;` : desktopSrc;
59
- const onErrorHandler = onErrorHandlerGenerator(errorImageSrc);
60
-
61
- return (
62
- <ImageStyled
63
- aspectRatio={AspectRatioDefinitions[aspectRatio]}
64
- srcSet={srcSet}
65
- sizes="(max-width: 600px) 200px, 50vw"
66
- alt={altText}
67
- onError={onErrorHandler}
68
- />
69
- );
70
- };
71
-
72
- export default Image;
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import { render } from '@testing-library/react';
3
- import ImageAspectRatioWrapper from './ImageAspectRatioWrapper';
4
-
5
- describe('ImageAspectRatioWrapper component', () => {
6
- const Image = () => <img data-testid="test-image" src="/foo" alt="test" />;
7
-
8
- it('renders image with specific style', () => {
9
- const { getByTestId } = render(
10
- <ImageAspectRatioWrapper>
11
- <Image />
12
- </ImageAspectRatioWrapper>
13
- );
14
- const image = getByTestId('test-image');
15
-
16
- expect(image).toHaveStyle({
17
- display: 'block',
18
- width: '100%',
19
- height: '100%',
20
- 'object-fit': 'cover',
21
- });
22
- });
23
- });
@@ -1,71 +0,0 @@
1
- import React from 'react';
2
- import { Meta, Story } from '@storybook/react';
3
- import ImageAspectRatioWrapper from './ImageAspectRatioWrapper';
4
- import GlobalStyles from '../../../styles/GlobalStyles';
5
- import ThemeProvider from '../../../styles/ThemeProvider';
6
- import { ThemeType } from '../../../types/types';
7
- import { AspectRatio } from '../../../types/image';
8
- import EditorialImage from '../../../../external/images/editorial.jpeg';
9
-
10
- const meta: Meta = {
11
- title: 'Components/Foundations/ImageProportions',
12
- component: ImageAspectRatioWrapper,
13
- argTypes: {
14
- aspectRatio: {
15
- description: 'Aspect ratio applied to the image',
16
- },
17
- ref: {
18
- table: { disable: true },
19
- },
20
- theme: {
21
- table: { disable: true },
22
- },
23
- as: {
24
- table: { disable: true },
25
- },
26
- forwardedAs: {
27
- table: { disable: true },
28
- },
29
- },
30
- decorators: [
31
- (Story) => (
32
- <ThemeProvider theme={ThemeType.Core}>
33
- <GlobalStyles />
34
- {Story()}
35
- </ThemeProvider>
36
- ),
37
- ],
38
- parameters: {
39
- docs: {
40
- description: {
41
- component: 'This component is used to wrap common images, giving a specific aspect ratio',
42
- withSource: 'none',
43
- },
44
- },
45
- design: {
46
- type: 'figma',
47
- url:
48
- 'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/ROH%3A-Design-System-%26-Documentation?node-id=140%3A5699',
49
- },
50
- jest: ['ImageAspectRatioWrapper'],
51
- },
52
- };
53
-
54
- export default meta;
55
-
56
- interface IStorybookImageAspectRatioWrapperProps {
57
- aspectRatio: AspectRatio;
58
- }
59
-
60
- const ImageAspectRatioTemplate: Story<IStorybookImageAspectRatioWrapperProps> = (args) => (
61
- <div style={{ width: '15rem' }}>
62
- <ImageAspectRatioWrapper {...args}>
63
- <img src={EditorialImage} alt="test" />
64
- </ImageAspectRatioWrapper>
65
- </div>
66
- );
67
-
68
- export const ImageAspectRatio = ImageAspectRatioTemplate.bind({});
69
- ImageAspectRatio.args = {
70
- aspectRatio: AspectRatio['1:1'],
71
- };
@@ -1,15 +0,0 @@
1
- import styled from 'styled-components';
2
- import { AspectRatio, IImageAspectRatioWrapperProps } from '../../../types/image';
3
-
4
- const ImageAspectRatioWrapper = styled.div<IImageAspectRatioWrapperProps>`
5
- aspect-ratio: ${({ aspectRatio = AspectRatio['1:1'] }) => aspectRatio};
6
-
7
- img {
8
- display: block;
9
- width: 100%;
10
- height: 100%;
11
- object-fit: cover;
12
- }
13
- `;
14
-
15
- export default ImageAspectRatioWrapper;
@@ -1,3 +0,0 @@
1
- import ImageAspectRatioWrapper from './ImageAspectRatioWrapper';
2
-
3
- export default ImageAspectRatioWrapper;
@@ -1,51 +0,0 @@
1
- import React from 'react';
2
- import { Story, Meta } from '@storybook/react';
3
- import GlobalStyles from '../../../styles/GlobalStyles';
4
- import ThemeProvider from '../../../styles/ThemeProvider';
5
- import IndividualListing from './index';
6
- import { ThemeType } from '../../../types/types';
7
- import { IIndividualListing } from '../../../types/types';
8
-
9
- export default {
10
- title: 'Components/Event Core/Individual Listing',
11
- component: IndividualListing,
12
- parameters: {
13
- docs: {
14
- description: {
15
- component: 'IndividualListing desc.',
16
- withSource: 'none',
17
- },
18
- },
19
- design: {
20
- type: 'figma',
21
- url:
22
- 'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/ROH%3A-Design-System-%26-Documentation?node-id=1280%3A10997',
23
- },
24
- jest: ['IndividualListing'],
25
- },
26
- decorators: [
27
- (Story) => (
28
- <ThemeProvider theme={ThemeType.Core}>
29
- <GlobalStyles />
30
- {Story()}
31
- </ThemeProvider>
32
- ),
33
- ],
34
- } as Meta;
35
-
36
- const Template: Story<IIndividualListing> = (args) => <IndividualListing {...args} />;
37
-
38
- export const IndividualListingLink = Template.bind({});
39
-
40
- IndividualListingLink.args = {
41
- role: 'Manager',
42
- name: 'Peter',
43
- link: 'https://google.com',
44
- };
45
-
46
- export const IndividualListingNoLink = Template.bind({});
47
-
48
- IndividualListingNoLink.args = {
49
- role: 'Manager',
50
- name: 'Peter',
51
- };
@@ -1,33 +0,0 @@
1
- import styled from 'styled-components';
2
-
3
- export const RoleWrapper = styled.div`
4
- font-family: var(--font-family-people-listing-role);
5
- font-size: var(--font-size-overline-1);
6
- font-weight: var(--font-weigth-overline-1);
7
- line-height: var(--line-height-overline-1);
8
- letter-spacing: var(--letter-spacing-overline-1);
9
- text-transform: var(--text-transform-overline-1);
10
- color: var(--base-color-darkgrey);
11
- overflow-wrap: break-word;
12
- `;
13
-
14
- export const NameWrapper = styled.div`
15
- font-family: var(--font-family-people-listing-name);
16
- font-size: var(--font-size-individual-listing-name);
17
- font-weight: var(--font-weigth-listing-name);
18
- line-height: var(--line-height-individual-listing-name);
19
- letter-spacing: var(--letter-spacing-overline-1);
20
- overflow-wrap: break-word;
21
-
22
- & a {
23
- color: var(--base-color-black);
24
-
25
- :hover {
26
- color: var(--base-color-primary);
27
- }
28
- }
29
-
30
- :visited {
31
- color: var(--base-color-black);
32
- }
33
- `;
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import PeopleListingItem from './IndividualListing';
4
-
5
- describe('PeopleListingItem component', () => {
6
- it('renders text with the proper data and a link', () => {
7
- const person = {
8
- role: 'director',
9
- name: 'jason',
10
- link: 'https://google.com',
11
- };
12
-
13
- const { getByText } = render(<PeopleListingItem role={person.role} name={person.name} link={person.link} />);
14
-
15
- expect(getByText(person.role)).toBeInTheDocument();
16
- expect(getByText(person.name)).toBeInTheDocument();
17
- expect(getByText(person.name).closest('a')).toHaveAttribute('href', person.link);
18
- });
19
-
20
- it('renders text with the proper data and no link', () => {
21
- const person = {
22
- role: 'director',
23
- name: 'jason',
24
- };
25
-
26
- render(<PeopleListingItem role={person.role} name={person.name} />);
27
- const link = screen.getByText(person.name).closest('a');
28
- expect(link).toBeNull();
29
- });
30
- });
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import { IIndividualListing } from '../../../types/types';
3
- import { RoleWrapper, NameWrapper } from './IndividualListing.style';
4
-
5
- const IndividualListing = ({ role, name, link, dataROH }: IIndividualListing) => {
6
- return (
7
- <span data-roh={dataROH}>
8
- <RoleWrapper title="role">{role}</RoleWrapper>
9
- <NameWrapper>
10
- {link ? (
11
- <a href={link} title={name}>
12
- {name}
13
- </a>
14
- ) : (
15
- name
16
- )}
17
- </NameWrapper>
18
- </span>
19
- );
20
- };
21
-
22
- export default IndividualListing;
@@ -1,3 +0,0 @@
1
- import IndividualListing from './IndividualListing';
2
-
3
- export default IndividualListing;
@@ -1,48 +0,0 @@
1
- import React from 'react';
2
- import { Meta, Story } from '@storybook/react';
3
- import Logo from './Logo';
4
- import styled from 'styled-components';
5
-
6
- const LogoSvg = styled(Logo)`
7
- width: 600px;
8
- height: 100%;
9
- `;
10
-
11
- const meta: Meta = {
12
- title: 'Foundations/Logo',
13
- component: Logo,
14
- argTypes: {
15
- ref: {
16
- table: { disable: true },
17
- },
18
- theme: {
19
- table: { disable: true },
20
- },
21
- as: {
22
- table: { disable: true },
23
- },
24
- forwardedAs: {
25
- table: { disable: true },
26
- },
27
- },
28
- parameters: {
29
- controls: { disabled: true },
30
- options: { showPanel: false },
31
- },
32
- };
33
-
34
- export default meta;
35
-
36
- const Template: Story = (args) => <LogoSvg {...args} />;
37
-
38
- export const MainLogo = Template.bind({});
39
- MainLogo.args = {};
40
- MainLogo.parameters = {
41
- previewTabs: {
42
- canvas: { hidden: false },
43
- },
44
- design: {
45
- type: 'figma',
46
- url: 'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/Royal-Opera-House-UI-Guide-and-Spec?node-id=3%3A2593',
47
- },
48
- };
@@ -1,18 +0,0 @@
1
- import styled from 'styled-components';
2
-
3
- const icon = styled.svg.attrs({
4
- version: '1.1',
5
- xmlns: 'http://www.w3.org/2000/svg',
6
- xmlnsXlink: 'http://www.w3.org/1999/xlink',
7
- })``;
8
-
9
- export const Svg = styled(icon)`
10
- width: 100%;
11
- height: 100%;
12
- `;
13
-
14
- export const SvgWrapper = styled.div`
15
- width: 400px;
16
- height: auto;
17
- cursor: pointer;
18
- `;