@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,53 @@
|
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
PromoWithTitleGrid,
|
|
4
|
+
PromoWithTitleImageWrapper,
|
|
5
|
+
PromoWithTitleContentWrapper,
|
|
6
|
+
PromoWithTitleSubtitle,
|
|
7
|
+
PromoWithTitleText,
|
|
8
|
+
PromoWithTitleContainer,
|
|
9
|
+
ButtonsContainer,
|
|
10
|
+
} from './PromoWithTitle.style';
|
|
11
|
+
import { ImageAspectRatioWrapper, Heading, PrimaryButton, TertiaryButton } from '../../atoms';
|
|
12
|
+
import { AspectRatio } from '../../../types/image';
|
|
13
|
+
import { IPromoWithTitleProps } from '../../../types/editorial';
|
|
14
|
+
|
|
15
|
+
const PromoWithTitle: FunctionComponent<IPromoWithTitleProps> = ({
|
|
16
|
+
imagePosition = 'left',
|
|
17
|
+
title,
|
|
18
|
+
titleSize = 'large',
|
|
19
|
+
subtitle,
|
|
20
|
+
text,
|
|
21
|
+
links,
|
|
22
|
+
children,
|
|
23
|
+
}) => {
|
|
24
|
+
const imageToLeft = imagePosition === 'left';
|
|
25
|
+
const titleLevel = titleSize === 'large' ? 2 : 3;
|
|
26
|
+
const primaryButton = links?.[0];
|
|
27
|
+
const { text: primaryButtonText, ...restPrimaryButton } = primaryButton || {};
|
|
28
|
+
const tertiaryButton = links?.[1];
|
|
29
|
+
const { text: tertiaryButtonText, ...restTertiaryButton } = tertiaryButton || {};
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<PromoWithTitleGrid imageToLeft={imageToLeft}>
|
|
33
|
+
<PromoWithTitleImageWrapper data-testid="image-wrapper" imageToLeft={imageToLeft}>
|
|
34
|
+
<ImageAspectRatioWrapper aspectRatio={AspectRatio['4:3']}>{children}</ImageAspectRatioWrapper>
|
|
35
|
+
</PromoWithTitleImageWrapper>
|
|
36
|
+
<PromoWithTitleContentWrapper data-testid="content-wrapper" imageToLeft={imageToLeft}>
|
|
37
|
+
<PromoWithTitleContainer>
|
|
38
|
+
<Heading level={titleLevel}>{title}</Heading>
|
|
39
|
+
</PromoWithTitleContainer>
|
|
40
|
+
{subtitle ? <PromoWithTitleSubtitle>{subtitle}</PromoWithTitleSubtitle> : null}
|
|
41
|
+
<PromoWithTitleText dangerouslySetInnerHTML={{ __html: text as string }} />
|
|
42
|
+
{links ? (
|
|
43
|
+
<ButtonsContainer data-testid="buttons-wrapper">
|
|
44
|
+
{primaryButton ? <PrimaryButton {...restPrimaryButton}>{primaryButtonText}</PrimaryButton> : null}
|
|
45
|
+
{tertiaryButton ? <TertiaryButton {...restTertiaryButton}>{tertiaryButtonText}</TertiaryButton> : null}
|
|
46
|
+
</ButtonsContainer>
|
|
47
|
+
) : null}
|
|
48
|
+
</PromoWithTitleContentWrapper>
|
|
49
|
+
</PromoWithTitleGrid>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default PromoWithTitle;
|
|
@@ -0,0 +1,35 @@
|
|
|
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 SearchBar from './index';
|
|
6
|
+
import { ThemeType } from '../../../types/types';
|
|
7
|
+
import { ISearchBarProps } from '../../../types/navigation';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Components/Navigation/SearchBar',
|
|
11
|
+
component: SearchBar,
|
|
12
|
+
parameters: {
|
|
13
|
+
design: {
|
|
14
|
+
type: 'figma',
|
|
15
|
+
url: 'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/Royal-Opera-House-UI-Guide-and-Spec?node-id=166%3A0',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
decorators: [
|
|
19
|
+
(Story) => (
|
|
20
|
+
<ThemeProvider theme={ThemeType.Core}>
|
|
21
|
+
<GlobalStyles />
|
|
22
|
+
{Story()}
|
|
23
|
+
</ThemeProvider>
|
|
24
|
+
),
|
|
25
|
+
],
|
|
26
|
+
} as Meta;
|
|
27
|
+
|
|
28
|
+
const Template: Story<ISearchBarProps> = (args) => <SearchBar {...args} />;
|
|
29
|
+
|
|
30
|
+
export const SearchBarDefault = Template.bind({});
|
|
31
|
+
|
|
32
|
+
SearchBarDefault.args = {
|
|
33
|
+
onClick: () => {},
|
|
34
|
+
onClose: () => {},
|
|
35
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { devices } from '../../../styles/viewports';
|
|
3
|
+
|
|
4
|
+
export const SearchBarContainer = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
column-gap: 64px;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
align-items: center;
|
|
10
|
+
height: 100px;
|
|
11
|
+
background-color: var(--base-color-white);
|
|
12
|
+
|
|
13
|
+
@media ${devices.mobile} {
|
|
14
|
+
column-gap: 12px;
|
|
15
|
+
height: 80px;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
export const SvgContainerSearch = styled.div`
|
|
20
|
+
svg {
|
|
21
|
+
width: var(--navigation-xlarge-gap);
|
|
22
|
+
height: var(--navigation-xlarge-gap);
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
export const SvgContainerClose = styled.div`
|
|
27
|
+
svg {
|
|
28
|
+
width: var(--navigation-large-gap);
|
|
29
|
+
height: var(--navigation-large-gap);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:hover {
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
&& svg path {
|
|
35
|
+
fill: var(--base-color-primary);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
export const InputContainer = styled.div`
|
|
41
|
+
background-color: blue;
|
|
42
|
+
width: 100%;
|
|
43
|
+
|
|
44
|
+
input {
|
|
45
|
+
font-size: var(--font-size-search);
|
|
46
|
+
font-family: var(--font-family-listing);
|
|
47
|
+
border: none;
|
|
48
|
+
outline: none;
|
|
49
|
+
outline-color: var(--base-color-white);
|
|
50
|
+
height: 48px;
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
width: 100%;
|
|
53
|
+
|
|
54
|
+
&.search-input {
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
text-overflow: ellipsis;
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@media ${devices.mobile} {
|
|
61
|
+
column-gap: 24px;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
|
|
66
|
+
export const SearchLinkContainer = styled.div``;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, fireEvent } from '@testing-library/react';
|
|
3
|
+
import SearchBar from './SearchBar';
|
|
4
|
+
|
|
5
|
+
describe('SearchBar component', () => {
|
|
6
|
+
const onSearchHandler = jest.fn();
|
|
7
|
+
const onCloseHandler = jest.fn();
|
|
8
|
+
const onChangeHandler = jest.fn();
|
|
9
|
+
|
|
10
|
+
it('renders text with specific text', () => {
|
|
11
|
+
const onSearch = onSearchHandler;
|
|
12
|
+
const onClose = onCloseHandler;
|
|
13
|
+
|
|
14
|
+
const { getByTestId } = render(
|
|
15
|
+
<SearchBar onChange={onChangeHandler} onClick={onSearch} onClose={onClose}></SearchBar>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
expect(getByTestId('close-icon')).toBeInTheDocument();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('calls onClose callback when click on close icon', () => {
|
|
22
|
+
const onSearch = onSearchHandler;
|
|
23
|
+
const onClose = onCloseHandler;
|
|
24
|
+
|
|
25
|
+
const { getByTestId } = render(
|
|
26
|
+
<SearchBar onChange={onChangeHandler} onClick={onSearch} onClose={onClose}></SearchBar>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
fireEvent.click(getByTestId('close-icon'));
|
|
30
|
+
expect(onCloseHandler).toBeCalled();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('should show Search button when change input', () => {
|
|
34
|
+
const onSearch = onSearchHandler;
|
|
35
|
+
const onClose = onCloseHandler;
|
|
36
|
+
|
|
37
|
+
const { getByTestId } = render(
|
|
38
|
+
<SearchBar onChange={onChangeHandler} onClick={onSearch} onClose={onClose}></SearchBar>
|
|
39
|
+
);
|
|
40
|
+
const input = getByTestId('input-html');
|
|
41
|
+
|
|
42
|
+
fireEvent.change(input, { target: { value: '23' } });
|
|
43
|
+
|
|
44
|
+
expect(getByTestId('search-button')).toBeInTheDocument();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('calls onSearch callback when click on search button', () => {
|
|
48
|
+
const onSearch = onSearchHandler;
|
|
49
|
+
const onClose = onCloseHandler;
|
|
50
|
+
|
|
51
|
+
const { getByTestId } = render(
|
|
52
|
+
<SearchBar onChange={onChangeHandler} onClick={onSearch} onClose={onClose}></SearchBar>
|
|
53
|
+
);
|
|
54
|
+
const input = getByTestId('input-html');
|
|
55
|
+
|
|
56
|
+
fireEvent.change(input, { target: { value: 'Iron Maiden Opera' } });
|
|
57
|
+
|
|
58
|
+
setTimeout(() => {
|
|
59
|
+
fireEvent.click(getByTestId('search-button'));
|
|
60
|
+
expect(onSearchHandler).toBeCalled();
|
|
61
|
+
}, 100);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
SearchBarContainer,
|
|
4
|
+
SvgContainerClose,
|
|
5
|
+
SvgContainerSearch,
|
|
6
|
+
InputContainer,
|
|
7
|
+
SearchLinkContainer,
|
|
8
|
+
} from './SearchBar.style';
|
|
9
|
+
import { ISearchBarProps } from '../../../types/navigation';
|
|
10
|
+
import SvgIcon from '../../atoms/Icons/Icons';
|
|
11
|
+
import TextLink from '../../atoms/TextLink';
|
|
12
|
+
import { Colors } from '../../../types/types';
|
|
13
|
+
|
|
14
|
+
const SearhBar = ({ onClick, onClose, onChange }: ISearchBarProps) => {
|
|
15
|
+
const [showSearchLink, setShowSearchLink] = useState(false);
|
|
16
|
+
const [searchValue, setSearchValue] = useState('');
|
|
17
|
+
|
|
18
|
+
const onSearchHandler = (value: string) => {
|
|
19
|
+
onClick(value);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const onCloseHandler = () => {
|
|
23
|
+
onClose();
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const onChangeHandler = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
const value = e.target.value;
|
|
29
|
+
if (value) {
|
|
30
|
+
setShowSearchLink(true);
|
|
31
|
+
setSearchValue(value);
|
|
32
|
+
onChange(true);
|
|
33
|
+
} else {
|
|
34
|
+
setShowSearchLink(false);
|
|
35
|
+
onChange(false);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<SearchBarContainer>
|
|
41
|
+
<SvgContainerSearch>
|
|
42
|
+
<SvgIcon iconName="Search" />
|
|
43
|
+
</SvgContainerSearch>
|
|
44
|
+
<InputContainer>
|
|
45
|
+
<input
|
|
46
|
+
data-testid="input-html"
|
|
47
|
+
className="search-input"
|
|
48
|
+
placeholder="Search for anything ROH..."
|
|
49
|
+
type="text"
|
|
50
|
+
onChange={(e) => {
|
|
51
|
+
onChangeHandler(e);
|
|
52
|
+
}}
|
|
53
|
+
/>
|
|
54
|
+
</InputContainer>
|
|
55
|
+
{showSearchLink && (
|
|
56
|
+
<SearchLinkContainer data-testid="search-button">
|
|
57
|
+
<TextLink color={Colors.ErrorState} onClick={() => onSearchHandler(searchValue)}>
|
|
58
|
+
SEARCH
|
|
59
|
+
</TextLink>
|
|
60
|
+
</SearchLinkContainer>
|
|
61
|
+
)}
|
|
62
|
+
<SvgContainerClose onClick={onCloseHandler} data-testid="close-icon">
|
|
63
|
+
<SvgIcon iconName="Close" />
|
|
64
|
+
</SvgContainerClose>
|
|
65
|
+
</SearchBarContainer>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export default SearhBar;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import SectionTitle from './SectionTitle';
|
|
4
|
+
import GlobalStyles from '../../../styles/GlobalStyles';
|
|
5
|
+
import ThemeProvider from '../../../styles/ThemeProvider';
|
|
6
|
+
import { ISectionTitleProps, ThemeType } from '../../../types/types';
|
|
7
|
+
|
|
8
|
+
const meta: Meta = {
|
|
9
|
+
title: 'Components/Editorial/Section Title',
|
|
10
|
+
component: SectionTitle,
|
|
11
|
+
parameters: {
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component:
|
|
15
|
+
'The Section Title is used as an introduction to different sections on a page. It creates a clear divide of information due to it’s large size.',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
design: {
|
|
19
|
+
type: 'figma',
|
|
20
|
+
url:
|
|
21
|
+
'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/ROH%3A-Design-System-%26-Documentation?node-id=1173%3A4965',
|
|
22
|
+
},
|
|
23
|
+
controls: { expanded: true },
|
|
24
|
+
jest: ['SectionTitle'],
|
|
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 SectionTitleTemplate: Story<ISectionTitleProps> = (args) => <SectionTitle {...args} />;
|
|
39
|
+
|
|
40
|
+
export const DefaultSectionTitleWithNoDescription = SectionTitleTemplate.bind({});
|
|
41
|
+
|
|
42
|
+
DefaultSectionTitleWithNoDescription.args = {
|
|
43
|
+
title: 'Section Title',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const DefaultSectionTitleWithDescription = SectionTitleTemplate.bind({});
|
|
47
|
+
|
|
48
|
+
DefaultSectionTitleWithDescription.args = {
|
|
49
|
+
title: 'Section Title',
|
|
50
|
+
description:
|
|
51
|
+
'Optional descriptive copy. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam fermentum pellentesque euismod imperdiet. Sed consect accumsan turpis et lorem pellentesque.',
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const LargeSectionTitleWithNoDescription = SectionTitleTemplate.bind({});
|
|
55
|
+
|
|
56
|
+
LargeSectionTitleWithNoDescription.args = {
|
|
57
|
+
title: 'Large Title',
|
|
58
|
+
size: 'large',
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const LargeSectionTitleWithDescription = SectionTitleTemplate.bind({});
|
|
62
|
+
|
|
63
|
+
LargeSectionTitleWithDescription.args = {
|
|
64
|
+
title: 'Large Title',
|
|
65
|
+
description:
|
|
66
|
+
'Optional descriptive copy. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam fermentum pellentesque euismod imperdiet. Sed consect accumsan turpis et lorem pellentesque.',
|
|
67
|
+
size: 'large',
|
|
68
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { devices } from '../../../styles/viewports';
|
|
3
|
+
|
|
4
|
+
const SectionTitleWrapper = styled.div`
|
|
5
|
+
margin: 30px 0;
|
|
6
|
+
|
|
7
|
+
& > div {
|
|
8
|
+
row-gap: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
& h1,
|
|
12
|
+
& h2 {
|
|
13
|
+
margin: 16px 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@media ${devices.mobile} {
|
|
17
|
+
& h1,
|
|
18
|
+
& h2 {
|
|
19
|
+
margin: 12px 0;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
& p {
|
|
24
|
+
font-family: var(--font-family-body);
|
|
25
|
+
font-style: normal;
|
|
26
|
+
font-weight: var(--font-weigth-body-1);
|
|
27
|
+
font-size: var(--font-size-title-description);
|
|
28
|
+
line-height: var(--line-height-title-description);
|
|
29
|
+
margin-block-start: 0;
|
|
30
|
+
word-break: break-word;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
export default SectionTitleWrapper;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import SectionTitle from './SectionTitle';
|
|
4
|
+
|
|
5
|
+
describe('SectionTitle component', () => {
|
|
6
|
+
it('renders by default as an h2', () => {
|
|
7
|
+
const title = 'Default setup';
|
|
8
|
+
const { getByText } = render(<SectionTitle title={title}></SectionTitle>);
|
|
9
|
+
|
|
10
|
+
expect(getByText(title).nodeName).toBe('H2');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('renders by as an h1 if set to large', () => {
|
|
14
|
+
const title = 'Large title';
|
|
15
|
+
const { getByText } = render(<SectionTitle title={title} size="large"></SectionTitle>);
|
|
16
|
+
|
|
17
|
+
expect(getByText(title).nodeName).toBe('H1');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('renders by a description if passed when small', () => {
|
|
21
|
+
const description = 'This is the description for a small title';
|
|
22
|
+
const { getByText } = render(
|
|
23
|
+
<SectionTitle title={'some title in small'} size={'small'} description={description}></SectionTitle>
|
|
24
|
+
);
|
|
25
|
+
expect(getByText(description)).toContainHTML(`<p>${description}</p>`);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('renders by a description if passed when large', () => {
|
|
29
|
+
const description = 'And this is the description for a large one';
|
|
30
|
+
const { getByText } = render(
|
|
31
|
+
<SectionTitle title={'some title in large'} size={'large'} description={description}></SectionTitle>
|
|
32
|
+
);
|
|
33
|
+
expect(getByText(description)).toContainHTML(`<p>${description}</p>`);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import SectionTitleWrapper from './SectionTitle.style';
|
|
3
|
+
import Heading from '../../atoms/Heading';
|
|
4
|
+
import { Grid, GridItem } from '../..';
|
|
5
|
+
import { ISectionTitleProps } from '../../../types/types';
|
|
6
|
+
|
|
7
|
+
const SectionTitle = ({ title, size = 'small', description }: ISectionTitleProps) => {
|
|
8
|
+
const headingLevel = size === 'large' ? 1 : 2;
|
|
9
|
+
return (
|
|
10
|
+
<SectionTitleWrapper>
|
|
11
|
+
<Grid>
|
|
12
|
+
<GridItem columnStartDesktop={3} columnSpanDesktop={12} columnStartDevice={2} columnSpanDevice={12}>
|
|
13
|
+
<Heading level={headingLevel}>{title}</Heading>
|
|
14
|
+
</GridItem>
|
|
15
|
+
{description && (
|
|
16
|
+
<GridItem columnStartDesktop={3} columnSpanDesktop={8} columnStartDevice={2} columnSpanDevice={12}>
|
|
17
|
+
<p>{description}</p>
|
|
18
|
+
</GridItem>
|
|
19
|
+
)}
|
|
20
|
+
</Grid>
|
|
21
|
+
</SectionTitleWrapper>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default SectionTitle;
|
|
@@ -0,0 +1,101 @@
|
|
|
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 Tabs from './index';
|
|
6
|
+
import { ITabsProps, ThemeType } from '../../../types/types';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Components/Navigation/Tabs',
|
|
10
|
+
component: Tabs,
|
|
11
|
+
parameters: {
|
|
12
|
+
design: {
|
|
13
|
+
type: 'figma',
|
|
14
|
+
url: 'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/Royal-Opera-House-UI-Guide-and-Spec?node-id=166%3A0',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
decorators: [
|
|
18
|
+
(Story) => (
|
|
19
|
+
<ThemeProvider theme={ThemeType.Core}>
|
|
20
|
+
<GlobalStyles />
|
|
21
|
+
{Story()}
|
|
22
|
+
</ThemeProvider>
|
|
23
|
+
),
|
|
24
|
+
],
|
|
25
|
+
} as Meta;
|
|
26
|
+
|
|
27
|
+
const Template: Story<ITabsProps> = (args) => <Tabs {...args} />;
|
|
28
|
+
|
|
29
|
+
export const TabsDefault = Template.bind({});
|
|
30
|
+
|
|
31
|
+
TabsDefault.args = {
|
|
32
|
+
showMenu: false,
|
|
33
|
+
onShowMenu: () => {},
|
|
34
|
+
onChange: () => {},
|
|
35
|
+
items: [
|
|
36
|
+
{
|
|
37
|
+
title: 'TEXT LINK 1',
|
|
38
|
+
options: [
|
|
39
|
+
{
|
|
40
|
+
option: 'OPTION 1 OPTION 1OPTION 1',
|
|
41
|
+
optionLink: 'link 1',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
option: 'OPTION 2',
|
|
45
|
+
optionLink: 'link 2',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
option: 'OPTION 3',
|
|
49
|
+
optionLink: 'link 3',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
title: 'TEXT LINK 2',
|
|
55
|
+
titleLink: 'textlink',
|
|
56
|
+
options: [],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: 'TEXT LINK 3',
|
|
60
|
+
options: [
|
|
61
|
+
{
|
|
62
|
+
option: 'OPTION 1',
|
|
63
|
+
optionLink: 'link 1',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
option: 'OPTION 2',
|
|
67
|
+
optionLink: 'link 2',
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
title: 'TEXT LINK 4',
|
|
73
|
+
options: [
|
|
74
|
+
{
|
|
75
|
+
option: 'OPTION 1',
|
|
76
|
+
optionLink: 'link 1',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
option: 'OPTION 2',
|
|
80
|
+
optionLink: 'link 2',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
option: 'OPTION 3',
|
|
84
|
+
optionLink: 'link 3',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
option: 'OPTION 4',
|
|
88
|
+
optionLink: 'link 4',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
option: 'OPTION 5',
|
|
92
|
+
optionLink: 'link 5',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
option: 'OPTION 6',
|
|
96
|
+
optionLink: 'link 6',
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { ITabsProps } from '../../../types/types';
|
|
3
|
+
import { devices } from '../../../styles/viewports';
|
|
4
|
+
|
|
5
|
+
export const TabsContainer = styled.div`
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
flex-direction: row;
|
|
8
|
+
column-gap: 32px;
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
export const ItemsContainer = styled.div<ITabsProps>`
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
column-gap: 32px;
|
|
15
|
+
|
|
16
|
+
@media ${devices.mobileAndTablet} {
|
|
17
|
+
${(props) => {
|
|
18
|
+
if (props.showMenu) {
|
|
19
|
+
return `
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
row-gap: 32px;
|
|
23
|
+
`;
|
|
24
|
+
}
|
|
25
|
+
return `display: none;`;
|
|
26
|
+
}}
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
export const MenuContainer = styled.div`
|
|
31
|
+
display: none;
|
|
32
|
+
width: 60px;
|
|
33
|
+
|
|
34
|
+
& a {
|
|
35
|
+
font-size: var(--font-size-navigation);
|
|
36
|
+
font-family: var(--font-family-navigation);
|
|
37
|
+
color: var(--base-color-black);
|
|
38
|
+
text-decoration: none;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
|
|
41
|
+
:hover {
|
|
42
|
+
color: var(--base-color-primary);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:hover {
|
|
47
|
+
&& svg path {
|
|
48
|
+
fill: var(--base-color-primary);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@media ${devices.mobileAndTablet} {
|
|
53
|
+
display: block;
|
|
54
|
+
|
|
55
|
+
svg {
|
|
56
|
+
width: 24px;
|
|
57
|
+
height: 24px;
|
|
58
|
+
margin-left: 40px;
|
|
59
|
+
margin-top: -20px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
a {
|
|
63
|
+
margin-left: 20px;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
export const MenuItem = styled.div`
|
|
69
|
+
@media ${devices.mobileAndTablet} {
|
|
70
|
+
a {
|
|
71
|
+
margin-left: 20px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`;
|