@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.
- package/LICENSE +21 -0
- package/README.md +82 -0
- package/dist/chord.cjs.development.js +3611 -0
- package/dist/chord.cjs.development.js.map +1 -0
- package/dist/chord.cjs.production.min.js +2 -0
- package/dist/chord.cjs.production.min.js.map +1 -0
- package/dist/chord.esm.js +3588 -0
- package/dist/chord.esm.js.map +1 -0
- package/dist/components/atoms/Account/Account.d.ts +3 -0
- package/dist/components/atoms/Account/index.d.ts +2 -0
- package/dist/components/atoms/Basket/Basket.d.ts +3 -0
- package/dist/components/atoms/Basket/Basket.style.d.ts +5 -0
- package/dist/components/atoms/Basket/index.d.ts +2 -0
- package/dist/components/atoms/Buttons/Button.d.ts +4 -0
- package/dist/components/atoms/Buttons/Button.style.d.ts +3 -0
- package/dist/components/atoms/Buttons/ButtonIconWrapper.style.d.ts +2 -0
- package/dist/components/atoms/Buttons/Primary/PrimaryButton.d.ts +4 -0
- package/dist/components/atoms/Buttons/Primary/PrimaryButtonWrapper.style.d.ts +4 -0
- package/dist/components/atoms/Buttons/Secondary/SecondaryButton.d.ts +4 -0
- package/dist/components/atoms/Buttons/Secondary/SecondaryButtonWrapper.style.d.ts +4 -0
- package/dist/components/atoms/Buttons/Tertiary/TertiaryButton.d.ts +4 -0
- package/dist/components/atoms/Buttons/Tertiary/TertiaryButton.style.d.ts +4 -0
- package/dist/components/atoms/Buttons/index.d.ts +4 -0
- package/dist/components/atoms/Dropdown/Dropdown.d.ts +3 -0
- package/dist/components/atoms/Dropdown/Dropdown.style.d.ts +4 -0
- package/dist/components/atoms/Dropdown/index.d.ts +2 -0
- package/dist/components/atoms/Grid/Grid.d.ts +2 -0
- package/dist/components/atoms/Grid/GridItem.d.ts +3 -0
- package/dist/components/atoms/Grid/index.d.ts +3 -0
- package/dist/components/atoms/Heading/Heading.d.ts +3 -0
- package/dist/components/atoms/Heading/Heading.style.d.ts +3 -0
- package/dist/components/atoms/Heading/index.d.ts +2 -0
- package/dist/components/atoms/Icons/Icons.d.ts +4 -0
- package/dist/components/atoms/Icons/Icons.style.d.ts +9 -0
- package/dist/components/atoms/Icons/StorybookSupport/Iconography.d.ts +10 -0
- package/dist/components/atoms/Icons/StorybookSupport/IconsDiv.style.d.ts +2 -0
- package/dist/components/atoms/Icons/SvgIcons/12px/Remove.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/12px/Tick.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Actions/AddToMyList.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Actions/BookTickets.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Actions/ChooseDates.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Actions/EditMyList.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Actions/Filter.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Actions/FindAScreening.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Actions/OnMyList.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Actions/Reminder.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Actions/Subscribe.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Actions/Watch.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Arrows/Arrow.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Arrows/CarouselArrow.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Arrows/DropdownArrow.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Descriptors/Cinema.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Descriptors/Clock.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Descriptors/CreditCard.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Descriptors/Email.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Descriptors/Info.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Descriptors/List.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Descriptors/Location.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Descriptors/PDF.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Descriptors/Phone.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Descriptors/Print.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Descriptors/Secure.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Descriptors/Tickets.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Logos/Social/Facebook.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Logos/Social/Instagram.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Logos/Social/Tiktok.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Logos/Social/Twitter.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Logos/Social/Youtube.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Logos/Sponsors/Sponsor.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Navigation/BalletAndDance.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Navigation/Basket.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Navigation/BasketFull.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Navigation/Home.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Navigation/LiveStream.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Navigation/Menu.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Navigation/OperaAndMusic.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Navigation/Search.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Navigation/Settings.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Navigation/User.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Navigation/UserSignedIn.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Text/Delete.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Text/Shift.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Text/Space.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Utility/Close.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Utility/Confirm.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Utility/Detract.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Utility/Expand.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Utility/ExternalLink.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Utility/GridView.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Utility/ListView.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Utility/Refresh.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Video/AudioDescription.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Video/Back10.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Video/Clips.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Video/Forward10.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Video/FullScreen.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Video/Minimise.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Video/Muted.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Video/Pause.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Video/Play.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Video/Restart.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Video/Subtitles.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Video/Trailer.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/Video/Volume.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/index.d.ts +71 -0
- package/dist/components/atoms/Icons/index.d.ts +2 -0
- package/dist/components/atoms/Image/Image.d.ts +38 -0
- package/dist/components/atoms/ImageAspectRatioWrapper/ImageAspectRatioWrapper.d.ts +3 -0
- package/dist/components/atoms/ImageAspectRatioWrapper/index.d.ts +2 -0
- package/dist/components/atoms/IndividualListing/IndividualListing.d.ts +3 -0
- package/dist/components/atoms/IndividualListing/IndividualListing.style.d.ts +2 -0
- package/dist/components/atoms/IndividualListing/index.d.ts +2 -0
- package/dist/components/atoms/Logo/Logo.d.ts +3 -0
- package/dist/components/atoms/Logo/Logo.style.d.ts +6 -0
- package/dist/components/atoms/Logo/index.d.ts +2 -0
- package/dist/components/atoms/Search/Search.d.ts +3 -0
- package/dist/components/atoms/Search/Search.style.d.ts +3 -0
- package/dist/components/atoms/Search/index.d.ts +2 -0
- package/dist/components/atoms/SectionSplitter/SectionSplitter.d.ts +3 -0
- package/dist/components/atoms/SectionSplitter/SectionSplitter.style.d.ts +2 -0
- package/dist/components/atoms/SectionSplitter/index.d.ts +2 -0
- package/dist/components/atoms/Sponsorship/Sponsorship.d.ts +4 -0
- package/dist/components/atoms/Sponsorship/index.d.ts +2 -0
- package/dist/components/atoms/Tab/Tab.d.ts +3 -0
- package/dist/components/atoms/Tab/Tab.style.d.ts +3 -0
- package/dist/components/atoms/Tab/index.d.ts +2 -0
- package/dist/components/atoms/TextLink/TextLink.d.ts +4 -0
- package/dist/components/atoms/TextLink/TextLink.style.d.ts +3 -0
- package/dist/components/atoms/TextLink/index.d.ts +2 -0
- package/dist/components/atoms/TypeTags/TypeTags.d.ts +3 -0
- package/dist/components/atoms/TypeTags/TypeTags.style.d.ts +2 -0
- package/dist/components/atoms/TypeTags/index.d.ts +2 -0
- package/dist/components/atoms/index.d.ts +9 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/molecules/ContactNewsletter/ContactNewsletter.d.ts +4 -0
- package/dist/components/molecules/ContactNewsletter/ContactNewsletter.style.d.ts +8 -0
- package/dist/components/molecules/ContactNewsletter/index.d.ts +2 -0
- package/dist/components/molecules/Editorial/Editorial.d.ts +4 -0
- package/dist/components/molecules/Editorial/Editorial.style.d.ts +6 -0
- package/dist/components/molecules/Editorial/index.d.ts +2 -0
- package/dist/components/molecules/NavTop/NavTop.d.ts +3 -0
- package/dist/components/molecules/NavTop/NavTop.style.d.ts +1 -0
- package/dist/components/molecules/NavTop/index.d.ts +2 -0
- package/dist/components/molecules/PeopleListing/PeopleListing.d.ts +3 -0
- package/dist/components/molecules/PeopleListing/PeopleListing.style.d.ts +2 -0
- package/dist/components/molecules/PeopleListing/index.d.ts +2 -0
- package/dist/components/molecules/PolicyLinks/PolicyLinks.d.ts +4 -0
- package/dist/components/molecules/PolicyLinks/PolicyLinks.style.d.ts +3 -0
- package/dist/components/molecules/PolicyLinks/index.d.ts +2 -0
- package/dist/components/molecules/PromoWithTitle/PromoWithTitle.d.ts +4 -0
- package/dist/components/molecules/PromoWithTitle/PromoWithTitle.style.d.ts +8 -0
- package/dist/components/molecules/PromoWithTitle/index.d.ts +2 -0
- package/dist/components/molecules/SearchBar/SearchBar.d.ts +3 -0
- package/dist/components/molecules/SearchBar/SearchBar.style.d.ts +5 -0
- package/dist/components/molecules/SearchBar/index.d.ts +2 -0
- package/dist/components/molecules/SectionTitle/SectionTitle.d.ts +3 -0
- package/dist/components/molecules/SectionTitle/SectionTitle.style.d.ts +2 -0
- package/dist/components/molecules/SectionTitle/index.d.ts +2 -0
- package/dist/components/molecules/Tabs/Tabs.d.ts +3 -0
- package/dist/components/molecules/Tabs/Tabs.style.d.ts +5 -0
- package/dist/components/molecules/Tabs/index.d.ts +2 -0
- package/dist/components/molecules/TextOnly/TextOnly.d.ts +4 -0
- package/dist/components/molecules/TextOnly/TextOnly.style.d.ts +1 -0
- package/dist/components/molecules/TextOnly/index.d.ts +2 -0
- package/dist/components/molecules/index.d.ts +6 -0
- package/dist/components/organisms/Footer/Footer.d.ts +4 -0
- package/dist/components/organisms/Footer/Footer.style.d.ts +6 -0
- package/dist/components/organisms/Footer/index.d.ts +2 -0
- package/dist/components/organisms/Navigation/Navigation.d.ts +3 -0
- package/dist/components/organisms/Navigation/Navigation.style.d.ts +7 -0
- package/dist/components/organisms/Navigation/index.d.ts +2 -0
- package/dist/components/organisms/index.d.ts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +8 -0
- package/dist/jest.setup.d.ts +1 -0
- package/dist/styles/GlobalStyles.d.ts +3 -0
- package/dist/styles/StorybookSupport/Colours/StorybookColourBox.d.ts +5 -0
- package/dist/styles/ThemeProvider.d.ts +3 -0
- package/dist/styles/themes.d.ts +2120 -0
- package/dist/styles/viewports.d.ts +13 -0
- package/dist/types/buttonTypes.d.ts +39 -0
- package/dist/types/editorial.d.ts +80 -0
- package/dist/types/footer.d.ts +41 -0
- package/dist/types/iconTypes.d.ts +33 -0
- package/dist/types/image.d.ts +12 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/navigation.d.ts +141 -0
- package/dist/types/types.d.ts +256 -0
- package/package.json +93 -0
- package/src/components/atoms/Account/Account.stories.tsx +93 -0
- package/src/components/atoms/Account/Account.test.tsx +54 -0
- package/src/components/atoms/Account/Account.tsx +25 -0
- package/src/components/atoms/Account/index.tsx +3 -0
- package/src/components/atoms/Basket/Basket.stories.tsx +79 -0
- package/src/components/atoms/Basket/Basket.style.tsx +74 -0
- package/src/components/atoms/Basket/Basket.test.tsx +35 -0
- package/src/components/atoms/Basket/Basket.tsx +34 -0
- package/src/components/atoms/Basket/index.tsx +3 -0
- package/src/components/atoms/Buttons/Button.style.tsx +31 -0
- package/src/components/atoms/Buttons/Button.tsx +21 -0
- package/src/components/atoms/Buttons/ButtonIconWrapper.style.tsx +10 -0
- package/src/components/atoms/Buttons/Buttons.stories.tsx +77 -0
- package/src/components/atoms/Buttons/Primary/PrimaryButton.stories.tsx +94 -0
- package/src/components/atoms/Buttons/Primary/PrimaryButton.test.tsx +39 -0
- package/src/components/atoms/Buttons/Primary/PrimaryButton.tsx +14 -0
- package/src/components/atoms/Buttons/Primary/PrimaryButtonWrapper.style.tsx +11 -0
- package/src/components/atoms/Buttons/Secondary/SecondaryButton.stories.tsx +84 -0
- package/src/components/atoms/Buttons/Secondary/SecondaryButton.test.tsx +39 -0
- package/src/components/atoms/Buttons/Secondary/SecondaryButton.tsx +14 -0
- package/src/components/atoms/Buttons/Secondary/SecondaryButtonWrapper.style.tsx +11 -0
- package/src/components/atoms/Buttons/Tertiary/TertiaryButton.stories.tsx +73 -0
- package/src/components/atoms/Buttons/Tertiary/TertiaryButton.style.tsx +29 -0
- package/src/components/atoms/Buttons/Tertiary/TertiaryButton.test.tsx +29 -0
- package/src/components/atoms/Buttons/Tertiary/TertiaryButton.tsx +18 -0
- package/src/components/atoms/Buttons/index.tsx +5 -0
- package/src/components/atoms/Dropdown/Dropdown.stories.tsx +153 -0
- package/src/components/atoms/Dropdown/Dropdown.style.tsx +64 -0
- package/src/components/atoms/Dropdown/Dropdown.test.tsx +67 -0
- package/src/components/atoms/Dropdown/Dropdown.tsx +131 -0
- package/src/components/atoms/Dropdown/index.tsx +3 -0
- package/src/components/atoms/Grid/Grid.stories.tsx +127 -0
- package/src/components/atoms/Grid/Grid.test.tsx +17 -0
- package/src/components/atoms/Grid/Grid.tsx +11 -0
- package/src/components/atoms/Grid/GridItem.test.tsx +25 -0
- package/src/components/atoms/Grid/GridItem.tsx +24 -0
- package/src/components/atoms/Grid/index.tsx +3 -0
- package/src/components/atoms/Heading/Heading.stories.tsx +44 -0
- package/src/components/atoms/Heading/Heading.style.tsx +14 -0
- package/src/components/atoms/Heading/Heading.test.tsx +13 -0
- package/src/components/atoms/Heading/Heading.tsx +15 -0
- package/src/components/atoms/Heading/index.tsx +3 -0
- package/src/components/atoms/Icons/Icons.stories.tsx +190 -0
- package/src/components/atoms/Icons/Icons.style.tsx +24 -0
- package/src/components/atoms/Icons/Icons.test.tsx +31 -0
- package/src/components/atoms/Icons/Icons.tsx +20 -0
- package/src/components/atoms/Icons/StorybookSupport/Iconography.tsx +27 -0
- package/src/components/atoms/Icons/StorybookSupport/IconsDiv.style.tsx +49 -0
- package/src/components/atoms/Icons/SvgIcons/12px/Remove.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/12px/Tick.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Actions/AddToMyList.svg.tsx +13 -0
- package/src/components/atoms/Icons/SvgIcons/Actions/BookTickets.svg.tsx +20 -0
- package/src/components/atoms/Icons/SvgIcons/Actions/ChooseDates.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Actions/EditMyList.svg.tsx +16 -0
- package/src/components/atoms/Icons/SvgIcons/Actions/Filter.svg.tsx +19 -0
- package/src/components/atoms/Icons/SvgIcons/Actions/FindAScreening.svg.tsx +31 -0
- package/src/components/atoms/Icons/SvgIcons/Actions/OnMyList.svg.tsx +16 -0
- package/src/components/atoms/Icons/SvgIcons/Actions/Reminder.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Actions/Subscribe.svg.tsx +9 -0
- package/src/components/atoms/Icons/SvgIcons/Actions/Watch.svg.tsx +9 -0
- package/src/components/atoms/Icons/SvgIcons/Arrows/Arrow.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Arrows/CarouselArrow.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Arrows/DropdownArrow.svg.tsx +8 -0
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Cinema.svg.tsx +31 -0
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Clock.svg.tsx +15 -0
- package/src/components/atoms/Icons/SvgIcons/Descriptors/CreditCard.svg.tsx +19 -0
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Email.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Info.svg.tsx +13 -0
- package/src/components/atoms/Icons/SvgIcons/Descriptors/List.svg.tsx +22 -0
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Location.svg.tsx +15 -0
- package/src/components/atoms/Icons/SvgIcons/Descriptors/PDF.svg.tsx +20 -0
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Phone.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Print.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Secure.svg.tsx +15 -0
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Tickets.svg.tsx +13 -0
- package/src/components/atoms/Icons/SvgIcons/Logos/Social/Facebook.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Logos/Social/Instagram.svg.tsx +19 -0
- package/src/components/atoms/Icons/SvgIcons/Logos/Social/Tiktok.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Logos/Social/Twitter.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Logos/Social/Youtube.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Logos/Sponsors/Sponsor.svg.tsx +26 -0
- package/src/components/atoms/Icons/SvgIcons/Navigation/BalletAndDance.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Navigation/Basket.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Navigation/BasketFull.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Navigation/Home.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Navigation/LiveStream.svg.tsx +24 -0
- package/src/components/atoms/Icons/SvgIcons/Navigation/Menu.svg.tsx +10 -0
- package/src/components/atoms/Icons/SvgIcons/Navigation/OperaAndMusic.svg.tsx +17 -0
- package/src/components/atoms/Icons/SvgIcons/Navigation/Search.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Navigation/Settings.svg.tsx +15 -0
- package/src/components/atoms/Icons/SvgIcons/Navigation/User.svg.tsx +15 -0
- package/src/components/atoms/Icons/SvgIcons/Navigation/UserSignedIn.svg.tsx +12 -0
- package/src/components/atoms/Icons/SvgIcons/Text/Delete.svg.tsx +12 -0
- package/src/components/atoms/Icons/SvgIcons/Text/Shift.svg.tsx +8 -0
- package/src/components/atoms/Icons/SvgIcons/Text/Space.svg.tsx +8 -0
- package/src/components/atoms/Icons/SvgIcons/Utility/Close.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Utility/Confirm.svg.tsx +8 -0
- package/src/components/atoms/Icons/SvgIcons/Utility/Detract.svg.tsx +8 -0
- package/src/components/atoms/Icons/SvgIcons/Utility/Expand.svg.tsx +8 -0
- package/src/components/atoms/Icons/SvgIcons/Utility/ExternalLink.svg.tsx +12 -0
- package/src/components/atoms/Icons/SvgIcons/Utility/GridView.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Utility/ListView.svg.tsx +10 -0
- package/src/components/atoms/Icons/SvgIcons/Utility/Refresh.svg.tsx +15 -0
- package/src/components/atoms/Icons/SvgIcons/Video/AudioDescription.svg.tsx +16 -0
- package/src/components/atoms/Icons/SvgIcons/Video/Back10.svg.tsx +16 -0
- package/src/components/atoms/Icons/SvgIcons/Video/Clips.svg.tsx +10 -0
- package/src/components/atoms/Icons/SvgIcons/Video/Forward10.svg.tsx +16 -0
- package/src/components/atoms/Icons/SvgIcons/Video/FullScreen.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Video/Minimise.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Video/Muted.svg.tsx +15 -0
- package/src/components/atoms/Icons/SvgIcons/Video/Pause.svg.tsx +9 -0
- package/src/components/atoms/Icons/SvgIcons/Video/Play.svg.tsx +9 -0
- package/src/components/atoms/Icons/SvgIcons/Video/Restart.svg.tsx +11 -0
- package/src/components/atoms/Icons/SvgIcons/Video/Subtitles.svg.tsx +17 -0
- package/src/components/atoms/Icons/SvgIcons/Video/Trailer.svg.tsx +12 -0
- package/src/components/atoms/Icons/SvgIcons/Video/Volume.svg.tsx +19 -0
- package/src/components/atoms/Icons/SvgIcons/index.tsx +149 -0
- package/src/components/atoms/Icons/__snapshots__/Icons.test.tsx.snap +1954 -0
- package/src/components/atoms/Icons/index.tsx +2 -0
- package/src/components/atoms/Image/Image.tsx +72 -0
- package/src/components/atoms/ImageAspectRatioWrapper/ImageAspectRatio.test.tsx +23 -0
- package/src/components/atoms/ImageAspectRatioWrapper/ImageAspectRatioWrapper.stories.tsx +71 -0
- package/src/components/atoms/ImageAspectRatioWrapper/ImageAspectRatioWrapper.tsx +15 -0
- package/src/components/atoms/ImageAspectRatioWrapper/index.tsx +3 -0
- package/src/components/atoms/IndividualListing/IndividualListing.stories.tsx +51 -0
- package/src/components/atoms/IndividualListing/IndividualListing.style.tsx +33 -0
- package/src/components/atoms/IndividualListing/IndividualListing.test.tsx +30 -0
- package/src/components/atoms/IndividualListing/IndividualListing.tsx +22 -0
- package/src/components/atoms/IndividualListing/index.tsx +3 -0
- package/src/components/atoms/Logo/Logo.stories.tsx +48 -0
- package/src/components/atoms/Logo/Logo.style.tsx +18 -0
- package/src/components/atoms/Logo/Logo.tsx +30 -0
- package/src/components/atoms/Logo/index.tsx +3 -0
- package/src/components/atoms/Search/Search.stories.tsx +63 -0
- package/src/components/atoms/Search/Search.style.tsx +36 -0
- package/src/components/atoms/Search/Search.test.tsx +24 -0
- package/src/components/atoms/Search/Search.tsx +16 -0
- package/src/components/atoms/Search/index.tsx +3 -0
- package/src/components/atoms/SectionSplitter/SectionSplitter.stories.tsx +47 -0
- package/src/components/atoms/SectionSplitter/SectionSplitter.style.tsx +11 -0
- package/src/components/atoms/SectionSplitter/SectionSplitter.tsx +22 -0
- package/src/components/atoms/SectionSplitter/index.tsx +3 -0
- package/src/components/atoms/Sponsorship/Sponsorship.stories.tsx +38 -0
- package/src/components/atoms/Sponsorship/Sponsorship.test.tsx +36 -0
- package/src/components/atoms/Sponsorship/Sponsorship.tsx +53 -0
- package/src/components/atoms/Sponsorship/index.tsx +3 -0
- package/src/components/atoms/Tab/Tab.stories.tsx +67 -0
- package/src/components/atoms/Tab/Tab.style.tsx +105 -0
- package/src/components/atoms/Tab/Tab.test.tsx +28 -0
- package/src/components/atoms/Tab/Tab.tsx +34 -0
- package/src/components/atoms/Tab/index.tsx +3 -0
- package/src/components/atoms/TextLink/TextLink.stories.tsx +81 -0
- package/src/components/atoms/TextLink/TextLink.style.tsx +26 -0
- package/src/components/atoms/TextLink/TextLink.test.tsx +39 -0
- package/src/components/atoms/TextLink/TextLink.tsx +20 -0
- package/src/components/atoms/TextLink/index.tsx +3 -0
- package/src/components/atoms/TypeTags/TypeTags.stories.tsx +57 -0
- package/src/components/atoms/TypeTags/TypeTags.style.tsx +28 -0
- package/src/components/atoms/TypeTags/TypeTags.test.tsx +21 -0
- package/src/components/atoms/TypeTags/TypeTags.tsx +15 -0
- package/src/components/atoms/TypeTags/index.tsx +3 -0
- package/src/components/atoms/index.tsx +22 -0
- package/src/components/index.tsx +38 -0
- package/src/components/molecules/ContactNewsletter/ContactNewsletter.style.tsx +116 -0
- package/src/components/molecules/ContactNewsletter/ContactNewsletter.test.tsx +85 -0
- package/src/components/molecules/ContactNewsletter/ContactNewsletter.tsx +51 -0
- package/src/components/molecules/ContactNewsletter/index.tsx +3 -0
- package/src/components/molecules/Editorial/Editorial.stories.tsx +78 -0
- package/src/components/molecules/Editorial/Editorial.style.tsx +73 -0
- package/src/components/molecules/Editorial/Editorial.test.tsx +73 -0
- package/src/components/molecules/Editorial/Editorial.tsx +32 -0
- package/src/components/molecules/Editorial/index.tsx +3 -0
- package/src/components/molecules/NavTop/NavTop.stories.tsx +95 -0
- package/src/components/molecules/NavTop/NavTop.style.tsx +14 -0
- package/src/components/molecules/NavTop/NavTop.test.tsx +113 -0
- package/src/components/molecules/NavTop/NavTop.tsx +27 -0
- package/src/components/molecules/NavTop/index.tsx +3 -0
- package/src/components/molecules/PeopleListing/PeopleListing.stories.tsx +185 -0
- package/src/components/molecules/PeopleListing/PeopleListing.style.tsx +8 -0
- package/src/components/molecules/PeopleListing/PeopleListing.test.tsx +24 -0
- package/src/components/molecules/PeopleListing/PeopleListing.tsx +27 -0
- package/src/components/molecules/PeopleListing/index.tsx +3 -0
- package/src/components/molecules/PolicyLinks/PolicyLinks.style.tsx +41 -0
- package/src/components/molecules/PolicyLinks/PolicyLinks.test.tsx +28 -0
- package/src/components/molecules/PolicyLinks/PolicyLinks.tsx +19 -0
- package/src/components/molecules/PolicyLinks/index.tsx +3 -0
- package/src/components/molecules/PromoWithTitle/PromoWithTitle.stories.tsx +119 -0
- package/src/components/molecules/PromoWithTitle/PromoWithTitle.style.tsx +108 -0
- package/src/components/molecules/PromoWithTitle/PromoWithTitle.test.tsx +75 -0
- package/src/components/molecules/PromoWithTitle/PromoWithTitle.tsx +53 -0
- package/src/components/molecules/PromoWithTitle/index.tsx +3 -0
- package/src/components/molecules/SearchBar/SearchBar.stories.tsx +35 -0
- package/src/components/molecules/SearchBar/SearchBar.style.tsx +66 -0
- package/src/components/molecules/SearchBar/SearchBar.test.tsx +63 -0
- package/src/components/molecules/SearchBar/SearchBar.tsx +69 -0
- package/src/components/molecules/SearchBar/index.tsx +3 -0
- package/src/components/molecules/SectionTitle/SectionTitle.stories.tsx +68 -0
- package/src/components/molecules/SectionTitle/SectionTitle.style.tsx +34 -0
- package/src/components/molecules/SectionTitle/SectionTitle.test.tsx +35 -0
- package/src/components/molecules/SectionTitle/SectionTitle.tsx +25 -0
- package/src/components/molecules/SectionTitle/index.tsx +3 -0
- package/src/components/molecules/Tabs/Tabs.stories.tsx +101 -0
- package/src/components/molecules/Tabs/Tabs.style.tsx +74 -0
- package/src/components/molecules/Tabs/Tabs.test.tsx +149 -0
- package/src/components/molecules/Tabs/Tabs.tsx +67 -0
- package/src/components/molecules/Tabs/index.tsx +3 -0
- package/src/components/molecules/TextOnly/TextOnly.stories.tsx +74 -0
- package/src/components/molecules/TextOnly/TextOnly.style.tsx +56 -0
- package/src/components/molecules/TextOnly/TextOnly.test.tsx +79 -0
- package/src/components/molecules/TextOnly/TextOnly.tsx +16 -0
- package/src/components/molecules/TextOnly/index.tsx +3 -0
- package/src/components/molecules/index.tsx +7 -0
- package/src/components/organisms/Footer/Footer.stories.tsx +54 -0
- package/src/components/organisms/Footer/Footer.style.tsx +72 -0
- package/src/components/organisms/Footer/Footer.test.tsx +31 -0
- package/src/components/organisms/Footer/Footer.tsx +53 -0
- package/src/components/organisms/Footer/exampleData.json +78 -0
- package/src/components/organisms/Footer/index.tsx +3 -0
- package/src/components/organisms/Navigation/Navigation.stories.tsx +110 -0
- package/src/components/organisms/Navigation/Navigation.style.tsx +87 -0
- package/src/components/organisms/Navigation/Navigation.test.tsx +115 -0
- package/src/components/organisms/Navigation/Navigation.tsx +109 -0
- package/src/components/organisms/Navigation/index.tsx +3 -0
- package/src/components/organisms/Navigation/menuData.json +104 -0
- package/src/components/organisms/index.tsx +4 -0
- package/src/index.tsx +44 -0
- package/src/jest.setup.ts +1 -0
- package/src/styles/GlobalStyles.tsx +205 -0
- package/src/styles/StorybookSupport/Colours/Colours.stories.mdx +101 -0
- package/src/styles/StorybookSupport/Colours/StorybookColourBox.tsx +32 -0
- package/src/styles/ThemeProvider.tsx +11 -0
- package/src/styles/themes.ts +398 -0
- package/src/styles/viewports.ts +14 -0
- package/src/types/buttonTypes.ts +42 -0
- package/src/types/editorial.ts +84 -0
- package/src/types/footer.ts +49 -0
- package/src/types/iconTypes.ts +38 -0
- package/src/types/image.ts +13 -0
- package/src/types/images.d.ts +1 -0
- package/src/types/index.tsx +5 -0
- package/src/types/navigation.ts +149 -0
- package/src/types/types.ts +276 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"policyLinks": [
|
|
3
|
+
{
|
|
4
|
+
"dataRoh": "PrivacyPolicy",
|
|
5
|
+
"title": "Privacy Policy",
|
|
6
|
+
"href": "#",
|
|
7
|
+
"name": "privacy-policy"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"dataRoh": "CookiesUsage",
|
|
11
|
+
"title": "Cookies Usage",
|
|
12
|
+
"href": "#",
|
|
13
|
+
"name": "cookies-usage"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"dataRoh": "Terms&Conditions",
|
|
17
|
+
"title": "Terms & Conditions of sale",
|
|
18
|
+
"href": "#",
|
|
19
|
+
"name": "terms-conditions"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"dataRoh": "CommunityGuidelines",
|
|
23
|
+
"title": "Community Guidelines",
|
|
24
|
+
"href": "#",
|
|
25
|
+
"name": "comunity"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"dataRoh": "CorporatePolicy",
|
|
29
|
+
"title": "Corporate Policy",
|
|
30
|
+
"href": "#",
|
|
31
|
+
"name": "corporate"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"socialMediaLinks": [
|
|
35
|
+
{
|
|
36
|
+
"dataRoh": "Facebook",
|
|
37
|
+
"href": "https://www.facebook.com/royaloperahouse",
|
|
38
|
+
"name": "Facebook"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"dataRoh": "Twitter",
|
|
42
|
+
"href": "https://twitter.com/royaloperahouse",
|
|
43
|
+
"name": "Twitter"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"dataRoh": "TikTok",
|
|
47
|
+
"href": "https://www.tiktok.com/@royaloperahouse",
|
|
48
|
+
"name": "Tiktok"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"dataRoh": "Instagram",
|
|
52
|
+
"href": "https://www.instagram.com/royaloperahouse",
|
|
53
|
+
"name": "Instagram"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"dataRoh": "Youtube",
|
|
57
|
+
"href": "https://www.youtube.com/user/royaloperahouse",
|
|
58
|
+
"name": "Youtube"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"newsletter": {
|
|
62
|
+
"text": "Sign up now to our newsletter get our latest news, offers and alerts",
|
|
63
|
+
"link": {
|
|
64
|
+
"title": "SIGN UP",
|
|
65
|
+
"href": "#"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"contact": {
|
|
69
|
+
"title": "CONTACT US",
|
|
70
|
+
"href": "#"
|
|
71
|
+
},
|
|
72
|
+
"artsLogo": {
|
|
73
|
+
"href": "https://www.artscouncil.org.uk/",
|
|
74
|
+
"title": "Art Council England",
|
|
75
|
+
"dataRoh": "lnkArtsCouncil"
|
|
76
|
+
},
|
|
77
|
+
"additionalInfo": "Royal Opera House Covent Garden Foundation, a charitable company limited by guarantee incorporated in England and Wales (Company number 480523) Charity Registered (Number 211775)"
|
|
78
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
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 Navigation from './index';
|
|
6
|
+
import { ThemeType } from '../../../types/types';
|
|
7
|
+
import { INavigationProps } from '../../../types/navigation';
|
|
8
|
+
import data from './menuData.json';
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: 'Components/Navigation/Navigation',
|
|
12
|
+
component: Navigation,
|
|
13
|
+
argTypes: {
|
|
14
|
+
ref: {
|
|
15
|
+
table: { disable: true },
|
|
16
|
+
},
|
|
17
|
+
theme: {
|
|
18
|
+
table: { disable: true },
|
|
19
|
+
},
|
|
20
|
+
as: {
|
|
21
|
+
table: { disable: true },
|
|
22
|
+
},
|
|
23
|
+
forwardedAs: {
|
|
24
|
+
table: { disable: true },
|
|
25
|
+
},
|
|
26
|
+
api: {
|
|
27
|
+
name: 'Data source',
|
|
28
|
+
description: ' The data source that populates the component with content',
|
|
29
|
+
options: ['menu.json'],
|
|
30
|
+
control: { type: 'select' },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
parameters: {
|
|
34
|
+
docs: {
|
|
35
|
+
description: {
|
|
36
|
+
component: 'Navigation that will be present in every page',
|
|
37
|
+
withSource: 'none',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
design: {
|
|
41
|
+
type: 'figma',
|
|
42
|
+
url: 'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/Royal-Opera-House-UI-Guide-and-Spec?node-id=166%3A0',
|
|
43
|
+
},
|
|
44
|
+
jest: ['Navigation'],
|
|
45
|
+
},
|
|
46
|
+
decorators: [
|
|
47
|
+
(Story) => (
|
|
48
|
+
<ThemeProvider theme={ThemeType.Core}>
|
|
49
|
+
<GlobalStyles />
|
|
50
|
+
{Story()}
|
|
51
|
+
</ThemeProvider>
|
|
52
|
+
),
|
|
53
|
+
],
|
|
54
|
+
} as Meta;
|
|
55
|
+
|
|
56
|
+
const Template: Story<INavigationProps> = (args) => <Navigation {...args} />;
|
|
57
|
+
|
|
58
|
+
export const NavigationDefault = Template.bind({});
|
|
59
|
+
|
|
60
|
+
NavigationDefault.args = {
|
|
61
|
+
onLink: () => {},
|
|
62
|
+
onSearch: () => {},
|
|
63
|
+
menuData: data,
|
|
64
|
+
dataNavTop: {
|
|
65
|
+
accountText: 'SIGN IN',
|
|
66
|
+
accountIcon: 'User',
|
|
67
|
+
accountOptions: [
|
|
68
|
+
{
|
|
69
|
+
option: 'OPTION 1',
|
|
70
|
+
optionLink: 'link 1',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
option: 'OPTION 2',
|
|
74
|
+
optionLink: 'link 2',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
option: 'OPTION 3',
|
|
78
|
+
optionLink: 'link 3',
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const NavigationWithItemsInBasket = Template.bind({});
|
|
85
|
+
|
|
86
|
+
NavigationWithItemsInBasket.args = {
|
|
87
|
+
onLink: () => {},
|
|
88
|
+
onSearch: () => {},
|
|
89
|
+
menuData: data,
|
|
90
|
+
dataNavTop: {
|
|
91
|
+
accountText: 'USER NAME',
|
|
92
|
+
accountIcon: 'UserSignedIn',
|
|
93
|
+
accountOptions: [
|
|
94
|
+
{
|
|
95
|
+
option: 'OPTION 1',
|
|
96
|
+
optionLink: 'link 1',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
option: 'OPTION 2',
|
|
100
|
+
optionLink: 'link 2',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
option: 'OPTION 3',
|
|
104
|
+
optionLink: 'link 3',
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
basketText: '29 MINS',
|
|
108
|
+
basketNumItems: 5,
|
|
109
|
+
},
|
|
110
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Grid } from '../../atoms/Grid';
|
|
3
|
+
import { devices } from '../../../styles/viewports';
|
|
4
|
+
|
|
5
|
+
export const NavigationGrid = styled(Grid)`
|
|
6
|
+
background-color: var(--base-color-white);
|
|
7
|
+
height: 140px;
|
|
8
|
+
|
|
9
|
+
@media ${devices.mobile} {
|
|
10
|
+
height: 80px;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
export const NavigationGridSearch = styled(Grid)`
|
|
15
|
+
background-color: var(--base-color-white);
|
|
16
|
+
height: 100px;
|
|
17
|
+
border-top: 1px solid var(--base-color-light-grey);
|
|
18
|
+
opacity: 50%;
|
|
19
|
+
|
|
20
|
+
@media ${devices.mobile} {
|
|
21
|
+
height: 80px;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
export const NavigationGridMobile = styled(Grid)`
|
|
26
|
+
display: none;
|
|
27
|
+
|
|
28
|
+
@media ${devices.mobileAndTablet} {
|
|
29
|
+
display: grid;
|
|
30
|
+
background-color: var(--base-color-white);
|
|
31
|
+
padding-bottom: var(--navigation-large-margin);
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
export const LogoContainer = styled.div`
|
|
36
|
+
height: 140px;
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
|
|
41
|
+
&&& .Logosvg {
|
|
42
|
+
height: 96px;
|
|
43
|
+
width: 66px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media ${devices.mobile} {
|
|
47
|
+
height: 80px;
|
|
48
|
+
|
|
49
|
+
&&& .Logosvg {
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 64px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
export const MenuContainer = styled.div`
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
align-items: center;
|
|
60
|
+
height: 140px;
|
|
61
|
+
|
|
62
|
+
@media ${devices.mobileAndTablet} {
|
|
63
|
+
flex-direction: row;
|
|
64
|
+
height: 80px;
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
export const NavContainer = styled.div`
|
|
69
|
+
height: 40px;
|
|
70
|
+
margin-top: auto;
|
|
71
|
+
|
|
72
|
+
@media ${devices.mobileAndTablet} {
|
|
73
|
+
background-color: var(--base-color-white);
|
|
74
|
+
height: auto;
|
|
75
|
+
margin-top: 0px;
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
export const NavTopContainer = styled.div`
|
|
80
|
+
height: 26px;
|
|
81
|
+
margin-left: auto;
|
|
82
|
+
margin-top: 20px;
|
|
83
|
+
|
|
84
|
+
@media ${devices.mobileAndTablet} {
|
|
85
|
+
margin-top: 1px;
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, fireEvent } from '@testing-library/react';
|
|
3
|
+
import menuData from './menuData.json';
|
|
4
|
+
import Navigation from './Navigation';
|
|
5
|
+
import { IMenuProps, INavTopProps } from '../../../types/navigation';
|
|
6
|
+
|
|
7
|
+
describe('Navigation component', () => {
|
|
8
|
+
const onSearchHandler = jest.fn();
|
|
9
|
+
const onLinkHandler = jest.fn();
|
|
10
|
+
|
|
11
|
+
it('renders texts with specific text', () => {
|
|
12
|
+
const dataNavTop: INavTopProps = {
|
|
13
|
+
accountText: 'SIGN IN',
|
|
14
|
+
accountIcon: 'User',
|
|
15
|
+
basketText: '29 MINS',
|
|
16
|
+
basketNumItems: 8,
|
|
17
|
+
accountOptions: [
|
|
18
|
+
{
|
|
19
|
+
option: 'OPTION 1',
|
|
20
|
+
optionLink: 'link 1',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
option: 'OPTION 2',
|
|
24
|
+
optionLink: 'link 2',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
option: 'OPTION 3',
|
|
28
|
+
optionLink: 'link 3',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
const onSearch = onSearchHandler;
|
|
33
|
+
const onLink = onLinkHandler;
|
|
34
|
+
|
|
35
|
+
const { getByText } = render(
|
|
36
|
+
<Navigation menuData={menuData as IMenuProps} dataNavTop={dataNavTop} onSearch={onSearch} onLink={onLink} />
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
expect(getByText('SIGN IN')).toBeInTheDocument();
|
|
40
|
+
expect(getByText('29 MINS')).toBeInTheDocument();
|
|
41
|
+
expect(getByText('8')).toBeInTheDocument();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('calls onLink callback when nav text is clicked', () => {
|
|
45
|
+
const dataNavTop: INavTopProps = {
|
|
46
|
+
accountText: 'SIGN IN',
|
|
47
|
+
accountIcon: 'User',
|
|
48
|
+
basketText: '29 MINS',
|
|
49
|
+
basketNumItems: 8,
|
|
50
|
+
accountOptions: [
|
|
51
|
+
{
|
|
52
|
+
option: 'OPTION 1',
|
|
53
|
+
optionLink: 'link 1',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
option: 'OPTION 2',
|
|
57
|
+
optionLink: 'link 2',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
option: 'OPTION 3',
|
|
61
|
+
optionLink: 'link 3',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
};
|
|
65
|
+
const onSearch = onSearchHandler;
|
|
66
|
+
const onLink = onLinkHandler;
|
|
67
|
+
|
|
68
|
+
const { getByText } = render(
|
|
69
|
+
<Navigation menuData={menuData as IMenuProps} dataNavTop={dataNavTop} onSearch={onSearch} onLink={onLink} />
|
|
70
|
+
);
|
|
71
|
+
fireEvent.click(getByText('29 MINS'));
|
|
72
|
+
|
|
73
|
+
expect(onLinkHandler).toBeCalled();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('calls onSearch callback when click on Search Bar', () => {
|
|
77
|
+
const dataNavTop: INavTopProps = {
|
|
78
|
+
accountText: 'SIGN IN',
|
|
79
|
+
accountIcon: 'User',
|
|
80
|
+
basketText: '29 MINS',
|
|
81
|
+
basketNumItems: 8,
|
|
82
|
+
accountOptions: [
|
|
83
|
+
{
|
|
84
|
+
option: 'OPTION 1',
|
|
85
|
+
optionLink: 'link 1',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
option: 'OPTION 2',
|
|
89
|
+
optionLink: 'link 2',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
option: 'OPTION 3',
|
|
93
|
+
optionLink: 'link 3',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
};
|
|
97
|
+
const onSearch = onSearchHandler;
|
|
98
|
+
const onLink = onLinkHandler;
|
|
99
|
+
|
|
100
|
+
const { getByTestId } = render(
|
|
101
|
+
<Navigation menuData={menuData as IMenuProps} dataNavTop={dataNavTop} onSearch={onSearch} onLink={onLink} />
|
|
102
|
+
);
|
|
103
|
+
fireEvent.click(getByTestId('search-icon'));
|
|
104
|
+
|
|
105
|
+
setTimeout(() => {
|
|
106
|
+
const input = getByTestId('input-html');
|
|
107
|
+
fireEvent.change(input, { target: { value: 'Metallica Festival' } });
|
|
108
|
+
}, 100);
|
|
109
|
+
|
|
110
|
+
setTimeout(() => {
|
|
111
|
+
fireEvent.click(getByTestId('search-button'));
|
|
112
|
+
expect(onSearchHandler).toBeCalled();
|
|
113
|
+
}, 100);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
NavigationGrid,
|
|
4
|
+
NavigationGridMobile,
|
|
5
|
+
LogoContainer,
|
|
6
|
+
MenuContainer,
|
|
7
|
+
NavContainer,
|
|
8
|
+
NavTopContainer,
|
|
9
|
+
NavigationGridSearch,
|
|
10
|
+
} from './Navigation.style';
|
|
11
|
+
import { GridItem } from '../../atoms/Grid';
|
|
12
|
+
import Logo from '../../atoms/Logo';
|
|
13
|
+
import NavTop from '../../molecules/NavTop';
|
|
14
|
+
import { INavigationProps } from '../../../types/navigation';
|
|
15
|
+
import Tabs from '../../molecules/Tabs';
|
|
16
|
+
import SearchBar from '../../molecules/SearchBar';
|
|
17
|
+
|
|
18
|
+
const Navigation = ({ dataNavTop, menuData, onSearch, onLink }: INavigationProps) => {
|
|
19
|
+
const searchBarRef: React.LegacyRef<HTMLDivElement> = React.createRef();
|
|
20
|
+
const [navTopData, setNavTopData] = useState(dataNavTop);
|
|
21
|
+
const [showMenu, setShowMenu] = useState(false);
|
|
22
|
+
const [showSearch, setshowSearch] = useState(false);
|
|
23
|
+
const { items } = menuData;
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
setNavTopData(dataNavTop);
|
|
27
|
+
}, [dataNavTop]);
|
|
28
|
+
|
|
29
|
+
const onClickSearchHandler = () => {
|
|
30
|
+
setshowSearch(true);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const onLinkHandler = (link: string) => {
|
|
34
|
+
onLink(link);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const onShowMenuHandler = (show: boolean) => {
|
|
38
|
+
setShowMenu(show);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const onSearchHandler = (value: string) => {
|
|
42
|
+
onSearch(value);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const onCloseSearchHandler = () => {
|
|
46
|
+
setshowSearch(false);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const onChangeSearchHandler = (value: boolean) => {
|
|
50
|
+
if (value) {
|
|
51
|
+
searchBarRef.current!.style.opacity = '100%';
|
|
52
|
+
} else {
|
|
53
|
+
searchBarRef.current!.style.opacity = '50%';
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<>
|
|
59
|
+
<NavigationGrid>
|
|
60
|
+
<GridItem columnStartDesktop={2} columnSpanDesktop={1} columnStartDevice={2} columnSpanDevice={2}>
|
|
61
|
+
<LogoContainer>
|
|
62
|
+
<Logo></Logo>
|
|
63
|
+
</LogoContainer>
|
|
64
|
+
</GridItem>
|
|
65
|
+
<GridItem columnStartDesktop={3} columnSpanDesktop={13} columnStartDevice={4} columnSpanDevice={10}>
|
|
66
|
+
<MenuContainer>
|
|
67
|
+
<NavTopContainer>
|
|
68
|
+
<NavTop
|
|
69
|
+
accountIcon={navTopData.accountIcon}
|
|
70
|
+
accountOptions={navTopData.accountOptions}
|
|
71
|
+
accountText={navTopData.accountText}
|
|
72
|
+
basketText={navTopData.basketText}
|
|
73
|
+
basketNumItems={navTopData.basketNumItems}
|
|
74
|
+
onClickSearch={onClickSearchHandler}
|
|
75
|
+
onLink={onLinkHandler}
|
|
76
|
+
isShowSearch={showSearch}
|
|
77
|
+
></NavTop>
|
|
78
|
+
</NavTopContainer>
|
|
79
|
+
<NavContainer>
|
|
80
|
+
<Tabs items={items} onChange={onLinkHandler} onShowMenu={onShowMenuHandler}></Tabs>
|
|
81
|
+
</NavContainer>
|
|
82
|
+
</MenuContainer>
|
|
83
|
+
</GridItem>
|
|
84
|
+
</NavigationGrid>
|
|
85
|
+
{showMenu && (
|
|
86
|
+
<NavigationGridMobile>
|
|
87
|
+
<GridItem columnStartDevice={2} columnSpanDevice={10}>
|
|
88
|
+
<NavContainer>
|
|
89
|
+
<Tabs items={items} onChange={onLinkHandler} onShowMenu={onShowMenuHandler} showMenu={true}></Tabs>
|
|
90
|
+
</NavContainer>
|
|
91
|
+
</GridItem>
|
|
92
|
+
</NavigationGridMobile>
|
|
93
|
+
)}
|
|
94
|
+
{showSearch && (
|
|
95
|
+
<NavigationGridSearch ref={searchBarRef}>
|
|
96
|
+
<GridItem columnStartDesktop={2} columnSpanDesktop={14} columnStartDevice={2} columnSpanDevice={12}>
|
|
97
|
+
<SearchBar
|
|
98
|
+
onChange={onChangeSearchHandler}
|
|
99
|
+
onClick={onSearchHandler}
|
|
100
|
+
onClose={onCloseSearchHandler}
|
|
101
|
+
></SearchBar>
|
|
102
|
+
</GridItem>
|
|
103
|
+
</NavigationGridSearch>
|
|
104
|
+
)}
|
|
105
|
+
</>
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export default Navigation;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"items": [
|
|
3
|
+
{
|
|
4
|
+
"title": "TICKETS & EVENTS",
|
|
5
|
+
"options": [
|
|
6
|
+
{
|
|
7
|
+
"option": "WHAT'S ON",
|
|
8
|
+
"optionLink": "/what's-on"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"option": "TICKETS",
|
|
12
|
+
"optionLink": "/visit/tickets"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"title": "VISIT US",
|
|
18
|
+
"options": [
|
|
19
|
+
{
|
|
20
|
+
"option": "YOUR VISIT",
|
|
21
|
+
"optionLink": "/visit/your-visit"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"option": "ACCESSIBILITY",
|
|
25
|
+
"optionLink": "/visit/accessibility"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"title": "STREAM",
|
|
31
|
+
"options": [
|
|
32
|
+
{
|
|
33
|
+
"option": "STREAM",
|
|
34
|
+
"optionLink": "/visit/stream"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"option": "CINEMA",
|
|
38
|
+
"optionLink": "/visit/cinema"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"title": "SHOP",
|
|
44
|
+
"titleLink": "https://shop.roh.org.uk/",
|
|
45
|
+
"options": []
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"title": "NEWS",
|
|
49
|
+
"titleLink": "/news",
|
|
50
|
+
"options": []
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"title": "LEARNING",
|
|
54
|
+
"options": [
|
|
55
|
+
{
|
|
56
|
+
"option": "LEARNING PLATFORM",
|
|
57
|
+
"optionLink": "/learning/learning-platform"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"option": "YOUNG PEOPLE",
|
|
61
|
+
"optionLink": "/learning/young-people"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"option": "ADULTS",
|
|
65
|
+
"optionLink": "/learning/adults-learning"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"option": "COMMUNITIES",
|
|
69
|
+
"optionLink": "/learning/communities-3"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"option": "LEARNING IN THURROCK",
|
|
73
|
+
"optionLink": "/learning/learning-in-thurrock"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"title": "JOIN & SUPPORT",
|
|
79
|
+
"options": [
|
|
80
|
+
{
|
|
81
|
+
"option": "DONATE",
|
|
82
|
+
"optionLink": "/visit/donate"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"option": "BECOME A MEMBER",
|
|
86
|
+
"optionLink": "/visit/become-a-member"
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"title": "ABOUT",
|
|
92
|
+
"options": [
|
|
93
|
+
{
|
|
94
|
+
"option": "ORCHESTRA",
|
|
95
|
+
"optionLink": "/visit/orchestra"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"option": "CAREERS",
|
|
99
|
+
"optionLink": "/visit/careers"
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Editorial,
|
|
3
|
+
Footer,
|
|
4
|
+
GlobalStyles,
|
|
5
|
+
Grid,
|
|
6
|
+
GridItem,
|
|
7
|
+
Heading,
|
|
8
|
+
Icon,
|
|
9
|
+
Navigation,
|
|
10
|
+
PeopleListing,
|
|
11
|
+
PrimaryButton,
|
|
12
|
+
PromoWithTitle,
|
|
13
|
+
SecondaryButton,
|
|
14
|
+
SectionSplitter,
|
|
15
|
+
Sponsorship,
|
|
16
|
+
TertiaryButton,
|
|
17
|
+
TextOnly,
|
|
18
|
+
ThemeProvider,
|
|
19
|
+
TypeTags,
|
|
20
|
+
} from './components';
|
|
21
|
+
|
|
22
|
+
import { ThemeType } from './types/types';
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
Editorial,
|
|
26
|
+
Footer,
|
|
27
|
+
GlobalStyles,
|
|
28
|
+
Grid,
|
|
29
|
+
GridItem,
|
|
30
|
+
Icon,
|
|
31
|
+
Heading,
|
|
32
|
+
Navigation,
|
|
33
|
+
PeopleListing,
|
|
34
|
+
PrimaryButton,
|
|
35
|
+
PromoWithTitle,
|
|
36
|
+
SecondaryButton,
|
|
37
|
+
SectionSplitter,
|
|
38
|
+
Sponsorship,
|
|
39
|
+
TertiaryButton,
|
|
40
|
+
TextOnly,
|
|
41
|
+
ThemeProvider,
|
|
42
|
+
ThemeType,
|
|
43
|
+
TypeTags,
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|