@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
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@royaloperahouse/chord",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"author": "Royal Opera House",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"typings": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"src"
|
|
11
|
+
],
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=10"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"start": "tsdx watch",
|
|
17
|
+
"build": "tsdx build",
|
|
18
|
+
"test": "tsdx test --passWithNoTests",
|
|
19
|
+
"test:watch": "tsdx test --watch --verbose --passWithNoTests",
|
|
20
|
+
"lint": "tsdx lint src",
|
|
21
|
+
"prepare": "tsdx build",
|
|
22
|
+
"size": "size-limit",
|
|
23
|
+
"analyze": "size-limit --why",
|
|
24
|
+
"storybook": "start-storybook -s ./external -p 6006",
|
|
25
|
+
"build-storybook": "rm -rf ./storybook-static; build-storybook -s ./src -o ./storybook-static; cp -r ./external/ ./storybook-static/",
|
|
26
|
+
"test-storybook": "tsdx test --json --passWithNoTests --outputFile=./test/jest-test-results.json"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"react": ">=16"
|
|
30
|
+
},
|
|
31
|
+
"husky": {
|
|
32
|
+
"hooks": {
|
|
33
|
+
"pre-commit": "tsdx lint"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"prettier": {
|
|
37
|
+
"printWidth": 120,
|
|
38
|
+
"semi": true,
|
|
39
|
+
"singleQuote": true,
|
|
40
|
+
"trailingComma": "es5"
|
|
41
|
+
},
|
|
42
|
+
"module": "dist/design-system.esm.js",
|
|
43
|
+
"size-limit": [
|
|
44
|
+
{
|
|
45
|
+
"path": "dist/design-system.cjs.production.min.js",
|
|
46
|
+
"limit": "10 KB"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"path": "dist/design-system.esm.js",
|
|
50
|
+
"limit": "10 KB"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"jest": {
|
|
54
|
+
"setupFilesAfterEnv": [
|
|
55
|
+
"<rootDir>/src/jest.setup.ts"
|
|
56
|
+
],
|
|
57
|
+
"moduleNameMapper": {
|
|
58
|
+
"^react$": "<rootDir>/node_modules/react"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@babel/core": "^7.16.0",
|
|
63
|
+
"@size-limit/preset-small-lib": "^6.0.4",
|
|
64
|
+
"@storybook/addon-a11y": "^6.3.12",
|
|
65
|
+
"@storybook/addon-essentials": "^6.3.12",
|
|
66
|
+
"@storybook/addon-info": "^5.3.21",
|
|
67
|
+
"@storybook/addon-jest": "^6.3.12",
|
|
68
|
+
"@storybook/addon-links": "^6.3.12",
|
|
69
|
+
"@storybook/addons": "^6.3.12",
|
|
70
|
+
"@storybook/react": "^6.3.12",
|
|
71
|
+
"@testing-library/jest-dom": "^5.15.0",
|
|
72
|
+
"@testing-library/react": "^12.1.2",
|
|
73
|
+
"@testing-library/user-event": "^13.5.0",
|
|
74
|
+
"@types/jest": "^27.0.2",
|
|
75
|
+
"@types/react": "^17.0.34",
|
|
76
|
+
"@types/react-dom": "^17.0.11",
|
|
77
|
+
"@types/react-test-renderer": "^17.0.1",
|
|
78
|
+
"@types/styled-components": "^5.1.15",
|
|
79
|
+
"@types/testing-library__jest-dom": "^5.14.1",
|
|
80
|
+
"babel-loader": "^8.2.3",
|
|
81
|
+
"husky": "^7.0.4",
|
|
82
|
+
"react": "^17.0.2",
|
|
83
|
+
"react-dom": "^17.0.2",
|
|
84
|
+
"react-is": "^17.0.2",
|
|
85
|
+
"size-limit": "^6.0.4",
|
|
86
|
+
"storybook-addon-designs": "^6.2.0",
|
|
87
|
+
"storybook-addon-pseudo-states": "^1.0.0",
|
|
88
|
+
"ts-jest": "^27.0.7",
|
|
89
|
+
"tsdx": "^0.14.1",
|
|
90
|
+
"tslib": "^2.3.1",
|
|
91
|
+
"typescript": "^4.4.4"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
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 Account from './index';
|
|
6
|
+
import { ThemeType } from '../../../types/types';
|
|
7
|
+
import { IAccountProps } from '../../../types/navigation';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Components/Navigation/Account',
|
|
11
|
+
component: Account,
|
|
12
|
+
argTypes: {
|
|
13
|
+
ref: {
|
|
14
|
+
table: { disable: true },
|
|
15
|
+
},
|
|
16
|
+
theme: {
|
|
17
|
+
table: { disable: true },
|
|
18
|
+
},
|
|
19
|
+
as: {
|
|
20
|
+
table: { disable: true },
|
|
21
|
+
},
|
|
22
|
+
forwardedAs: {
|
|
23
|
+
table: { disable: true },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
parameters: {
|
|
27
|
+
docs: {
|
|
28
|
+
description: {
|
|
29
|
+
component: 'Account button',
|
|
30
|
+
withSource: 'none',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
design: {
|
|
34
|
+
type: 'figma',
|
|
35
|
+
url: 'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/Royal-Opera-House-UI-Guide-and-Spec?node-id=166%3A0',
|
|
36
|
+
},
|
|
37
|
+
jest: ['Account'],
|
|
38
|
+
},
|
|
39
|
+
decorators: [
|
|
40
|
+
(Story) => (
|
|
41
|
+
<ThemeProvider theme={ThemeType.Core}>
|
|
42
|
+
<GlobalStyles />
|
|
43
|
+
{Story()}
|
|
44
|
+
</ThemeProvider>
|
|
45
|
+
),
|
|
46
|
+
],
|
|
47
|
+
} as Meta;
|
|
48
|
+
|
|
49
|
+
const Template: Story<IAccountProps> = (args) => <Account {...args} />;
|
|
50
|
+
|
|
51
|
+
export const SignedOut = Template.bind({});
|
|
52
|
+
|
|
53
|
+
SignedOut.args = {
|
|
54
|
+
title: 'SIGN IN',
|
|
55
|
+
onClick: () => {},
|
|
56
|
+
iconName: 'User',
|
|
57
|
+
options: [
|
|
58
|
+
{
|
|
59
|
+
option: 'OPTION 1',
|
|
60
|
+
optionLink: 'link 1',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
option: 'OPTION 2',
|
|
64
|
+
optionLink: 'link 2',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
option: 'OPTION 3',
|
|
68
|
+
optionLink: 'link 3',
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const SignedIn = Template.bind({});
|
|
74
|
+
|
|
75
|
+
SignedIn.args = {
|
|
76
|
+
title: 'USER NAME',
|
|
77
|
+
onClick: () => {},
|
|
78
|
+
iconName: 'UserSignedIn',
|
|
79
|
+
options: [
|
|
80
|
+
{
|
|
81
|
+
option: 'OPTION 1',
|
|
82
|
+
optionLink: 'link 1',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
option: 'OPTION 2',
|
|
86
|
+
optionLink: 'link 2',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
option: 'OPTION 3',
|
|
90
|
+
optionLink: 'link 3',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, fireEvent } from '@testing-library/react';
|
|
3
|
+
import Account from './Account';
|
|
4
|
+
import { IOptionItem } from '../../../types/types';
|
|
5
|
+
|
|
6
|
+
describe('Account component', () => {
|
|
7
|
+
const onClickHandler = jest.fn();
|
|
8
|
+
|
|
9
|
+
it('renders text with specific text', () => {
|
|
10
|
+
const title = 'SIGN IN';
|
|
11
|
+
const options: IOptionItem[] = [];
|
|
12
|
+
const onClick = onClickHandler;
|
|
13
|
+
const iconName = 'User';
|
|
14
|
+
|
|
15
|
+
const { getByText } = render(
|
|
16
|
+
<Account title={title} options={options} onClick={onClick} iconName={iconName}></Account>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
expect(getByText(title)).toBeInTheDocument();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('calls onClick callback when text is clicked', () => {
|
|
23
|
+
const title = 'SIGN IN';
|
|
24
|
+
const options: IOptionItem[] = [];
|
|
25
|
+
const onClick = onClickHandler;
|
|
26
|
+
const iconName = 'User';
|
|
27
|
+
|
|
28
|
+
const { getByText } = render(
|
|
29
|
+
<Account title={title} options={options} onClick={onClick} iconName={iconName}></Account>
|
|
30
|
+
);
|
|
31
|
+
fireEvent.click(getByText('SIGN IN'));
|
|
32
|
+
|
|
33
|
+
expect(onClickHandler).toBeCalled();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('renders options when click text', () => {
|
|
37
|
+
const title = 'SIGN IN';
|
|
38
|
+
const options: IOptionItem[] = [
|
|
39
|
+
{
|
|
40
|
+
option: 'foo',
|
|
41
|
+
optionLink: 'bar',
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
const onClick = onClickHandler;
|
|
45
|
+
const iconName = 'User';
|
|
46
|
+
|
|
47
|
+
const { getByText } = render(
|
|
48
|
+
<Account title={title} options={options} onClick={onClick} iconName={iconName}></Account>
|
|
49
|
+
);
|
|
50
|
+
fireEvent.click(getByText('SIGN IN'));
|
|
51
|
+
|
|
52
|
+
expect(getByText('foo')).toBeInTheDocument();
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IAccountProps } from '../../../types/navigation';
|
|
3
|
+
import Dropdown from '../Dropdown';
|
|
4
|
+
|
|
5
|
+
const Account = ({ title, options = [], onClick, iconName, titleLink }: IAccountProps) => {
|
|
6
|
+
const onChangeHandler = (link: string) => {
|
|
7
|
+
if (onClick) {
|
|
8
|
+
onClick(link);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<Dropdown
|
|
14
|
+
titleLink={titleLink}
|
|
15
|
+
title={title}
|
|
16
|
+
options={options}
|
|
17
|
+
onChange={onChangeHandler}
|
|
18
|
+
iconName={iconName}
|
|
19
|
+
withOptionsInMobile={false}
|
|
20
|
+
withIcon={'left'}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default Account;
|
|
@@ -0,0 +1,79 @@
|
|
|
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 Basket from './index';
|
|
6
|
+
import { ThemeType } from '../../../types/types';
|
|
7
|
+
import { IBasketProps } from '../../../types/navigation';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Components/Navigation/Basket',
|
|
11
|
+
component: Basket,
|
|
12
|
+
argTypes: {
|
|
13
|
+
ref: {
|
|
14
|
+
table: { disable: true },
|
|
15
|
+
},
|
|
16
|
+
theme: {
|
|
17
|
+
table: { disable: true },
|
|
18
|
+
},
|
|
19
|
+
as: {
|
|
20
|
+
table: { disable: true },
|
|
21
|
+
},
|
|
22
|
+
forwardedAs: {
|
|
23
|
+
table: { disable: true },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
parameters: {
|
|
27
|
+
docs: {
|
|
28
|
+
description: {
|
|
29
|
+
component: 'Basket button',
|
|
30
|
+
withSource: 'none',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
design: {
|
|
34
|
+
type: 'figma',
|
|
35
|
+
url: 'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/Royal-Opera-House-UI-Guide-and-Spec?node-id=166%3A0',
|
|
36
|
+
},
|
|
37
|
+
jest: ['Basket'],
|
|
38
|
+
},
|
|
39
|
+
decorators: [
|
|
40
|
+
(Story) => (
|
|
41
|
+
<ThemeProvider theme={ThemeType.Core}>
|
|
42
|
+
<GlobalStyles />
|
|
43
|
+
{Story()}
|
|
44
|
+
</ThemeProvider>
|
|
45
|
+
),
|
|
46
|
+
],
|
|
47
|
+
} as Meta;
|
|
48
|
+
|
|
49
|
+
const Template: Story<IBasketProps> = (args) => <Basket {...args} />;
|
|
50
|
+
|
|
51
|
+
export const BasketEmpty = Template.bind({});
|
|
52
|
+
|
|
53
|
+
BasketEmpty.args = {
|
|
54
|
+
text: '',
|
|
55
|
+
selected: false,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const BasketEmptySelected = Template.bind({});
|
|
59
|
+
|
|
60
|
+
BasketEmptySelected.args = {
|
|
61
|
+
text: '',
|
|
62
|
+
selected: true,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const BasketFull = Template.bind({});
|
|
66
|
+
|
|
67
|
+
BasketFull.args = {
|
|
68
|
+
text: '29 MINS',
|
|
69
|
+
selected: false,
|
|
70
|
+
numItems: 5,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const BasketFullSelected = Template.bind({});
|
|
74
|
+
|
|
75
|
+
BasketFullSelected.args = {
|
|
76
|
+
text: '29 MINS',
|
|
77
|
+
selected: true,
|
|
78
|
+
numItems: 25,
|
|
79
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { IBasketProps } from '../../../types/navigation';
|
|
3
|
+
import { devices } from '../../../styles/viewports';
|
|
4
|
+
|
|
5
|
+
export const BasketContainer = styled.div<IBasketProps>`
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
flex-direction: row;
|
|
8
|
+
justify-content: flex-start;
|
|
9
|
+
align-items: center;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
border-bottom: 1px solid var(--base-color-transparent);
|
|
12
|
+
|
|
13
|
+
${(props) => {
|
|
14
|
+
if (props.selected) {
|
|
15
|
+
return `
|
|
16
|
+
border-bottom: 1px solid var(--base-color-primary);
|
|
17
|
+
&& a {
|
|
18
|
+
color: var(--base-color-primary);
|
|
19
|
+
}
|
|
20
|
+
&& svg path {
|
|
21
|
+
fill: var(--base-color-primary);
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
}
|
|
25
|
+
return '';
|
|
26
|
+
}}
|
|
27
|
+
|
|
28
|
+
:hover {
|
|
29
|
+
border-bottom: 1px solid var(--base-color-primary);
|
|
30
|
+
&& a {
|
|
31
|
+
color: var(--base-color-primary);
|
|
32
|
+
}
|
|
33
|
+
&& svg path {
|
|
34
|
+
fill: var(--base-color-primary);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
export const SvgContainer = styled.div`
|
|
40
|
+
position: relative;
|
|
41
|
+
|
|
42
|
+
svg {
|
|
43
|
+
width: var(--navigation-large-gap);
|
|
44
|
+
height: var(--navigation-large-gap);
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
export const NumContainer = styled.div`
|
|
49
|
+
display: flex;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
width: 12px;
|
|
52
|
+
height: 12px;
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 8px;
|
|
55
|
+
margin-left: 6px;
|
|
56
|
+
|
|
57
|
+
& .basket-num {
|
|
58
|
+
color: white;
|
|
59
|
+
font-size: 10px;
|
|
60
|
+
font-family: var(--font-family-navigation);
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
export const BasketText = styled.a`
|
|
65
|
+
font-size: var(--font-size-navigation);
|
|
66
|
+
font-family: var(--font-family-navigation);
|
|
67
|
+
color: var(--base-color-black);
|
|
68
|
+
margin-left: 6px;
|
|
69
|
+
text-decoration: none;
|
|
70
|
+
|
|
71
|
+
@media ${devices.mobile} {
|
|
72
|
+
display: none;
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, fireEvent } from '@testing-library/react';
|
|
3
|
+
import Basket from './Basket';
|
|
4
|
+
import '@testing-library/jest-dom';
|
|
5
|
+
|
|
6
|
+
describe('Basket component', () => {
|
|
7
|
+
const onClickHandler = jest.fn();
|
|
8
|
+
|
|
9
|
+
it('renders text with specific text', () => {
|
|
10
|
+
const text = '29 MINS';
|
|
11
|
+
const selected = false;
|
|
12
|
+
const numItems = 5;
|
|
13
|
+
|
|
14
|
+
const { getByText } = render(
|
|
15
|
+
<Basket text={text} selected={selected} onClick={onClickHandler} numItems={numItems}></Basket>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
expect(getByText(text)).toBeInTheDocument();
|
|
19
|
+
expect(getByText(numItems)).toBeInTheDocument();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('calls onLink callback when basket is clicked', () => {
|
|
23
|
+
const text = '29 MINS';
|
|
24
|
+
const selected = false;
|
|
25
|
+
const numItems = 5;
|
|
26
|
+
|
|
27
|
+
const { getByText } = render(
|
|
28
|
+
<Basket text={text} selected={selected} onClick={onClickHandler} numItems={numItems}></Basket>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
fireEvent.click(getByText('29 MINS'));
|
|
32
|
+
|
|
33
|
+
expect(onClickHandler).toBeCalled();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BasketContainer, SvgContainer, NumContainer, BasketText } from './Basket.style';
|
|
3
|
+
import { IBasketProps } from '../../../types/navigation';
|
|
4
|
+
import { Icon } from '../Icons';
|
|
5
|
+
|
|
6
|
+
const Basket = ({ text, selected = false, numItems = 0, onClick }: IBasketProps) => {
|
|
7
|
+
const onClickHandler = () => {
|
|
8
|
+
if (onClick) {
|
|
9
|
+
onClick('/basket');
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const empty = numItems <= 0;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<BasketContainer selected={selected} onClick={onClickHandler}>
|
|
17
|
+
<SvgContainer>
|
|
18
|
+
{empty ? (
|
|
19
|
+
<Icon iconName="Basket" />
|
|
20
|
+
) : (
|
|
21
|
+
<>
|
|
22
|
+
<Icon iconName="BasketFull" />
|
|
23
|
+
<NumContainer>
|
|
24
|
+
<span className={`basket-num`}>{numItems}</span>
|
|
25
|
+
</NumContainer>
|
|
26
|
+
</>
|
|
27
|
+
)}
|
|
28
|
+
</SvgContainer>
|
|
29
|
+
<div>{!empty ? <BasketText data-testid="baskettext">{text}</BasketText> : ''}</div>
|
|
30
|
+
</BasketContainer>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default Basket;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { IButtonProps } from '../../../types/buttonTypes';
|
|
3
|
+
import { devices } from '../../../styles/viewports';
|
|
4
|
+
|
|
5
|
+
const ButtonWrapper = styled.a<IButtonProps>`
|
|
6
|
+
padding: ${({ iconName }) => (iconName ? 'var(--button-padding-y-icon)' : 'var(--button-padding-y)')}
|
|
7
|
+
var(--button-padding-x);
|
|
8
|
+
height: var(--button-height);
|
|
9
|
+
font-family: var(--font-family-buttons);
|
|
10
|
+
font-size: var(--button-font-size);
|
|
11
|
+
font-weight: var(--button-font-weight);
|
|
12
|
+
color: var(--base-color-${({ color }) => color});
|
|
13
|
+
line-height: var(--button-line-height);
|
|
14
|
+
width: fit-content;
|
|
15
|
+
border-style: solid;
|
|
16
|
+
border-width: 1px;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
text-decoration: none;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
|
|
24
|
+
@media ${devices.mobile} {
|
|
25
|
+
& {
|
|
26
|
+
width: 100%;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
export default ButtonWrapper;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import ButtonWrapper from './Button.style';
|
|
3
|
+
import ButtonIconWrapper from './ButtonIconWrapper.style';
|
|
4
|
+
import { Icon } from '../Icons';
|
|
5
|
+
import { IButtonProps } from '../../../types/buttonTypes';
|
|
6
|
+
|
|
7
|
+
const Button: FunctionComponent<IButtonProps> = ({ children, iconName, iconDirection, color, ...rest }) => {
|
|
8
|
+
const truncatedString = (children as string).substring(0, 30);
|
|
9
|
+
return (
|
|
10
|
+
<ButtonWrapper {...rest} color={color} iconName={iconName}>
|
|
11
|
+
{iconName ? (
|
|
12
|
+
<ButtonIconWrapper data-testid="button-icon">
|
|
13
|
+
<Icon iconName={iconName} direction={iconDirection} color={color} />
|
|
14
|
+
</ButtonIconWrapper>
|
|
15
|
+
) : null}
|
|
16
|
+
{truncatedString}
|
|
17
|
+
</ButtonWrapper>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default Button;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
const ButtonIconWrapper = styled.span`
|
|
4
|
+
width: var(--button-icon-width);
|
|
5
|
+
height: var(--button-icon-height);
|
|
6
|
+
margin-right: var(--button-icon-margin);
|
|
7
|
+
display: inline-block;
|
|
8
|
+
`;
|
|
9
|
+
|
|
10
|
+
export default ButtonIconWrapper;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { MouseEventHandler } from 'react';
|
|
2
|
+
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import { PrimaryButton, SecondaryButton, TertiaryButton } from './';
|
|
4
|
+
import GlobalStyles from '../../../styles/GlobalStyles';
|
|
5
|
+
import ThemeProvider from '../../../styles/ThemeProvider';
|
|
6
|
+
import { ThemeType, Colors } from '../../../types/types';
|
|
7
|
+
import { IconNameType } from '../../../types/iconTypes';
|
|
8
|
+
|
|
9
|
+
const meta: Meta = {
|
|
10
|
+
title: 'Components/Foundations/Buttons/All',
|
|
11
|
+
argTypes: {
|
|
12
|
+
ref: {
|
|
13
|
+
table: { disable: true },
|
|
14
|
+
},
|
|
15
|
+
theme: {
|
|
16
|
+
table: { disable: true },
|
|
17
|
+
},
|
|
18
|
+
as: {
|
|
19
|
+
table: { disable: true },
|
|
20
|
+
},
|
|
21
|
+
forwardedAs: {
|
|
22
|
+
table: { disable: true },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
decorators: [
|
|
26
|
+
(Story) => (
|
|
27
|
+
<ThemeProvider theme={ThemeType.Core}>
|
|
28
|
+
<GlobalStyles />
|
|
29
|
+
{Story()}
|
|
30
|
+
</ThemeProvider>
|
|
31
|
+
),
|
|
32
|
+
],
|
|
33
|
+
parameters: {
|
|
34
|
+
docs: {
|
|
35
|
+
description: {
|
|
36
|
+
component: 'All buttons',
|
|
37
|
+
withSource: 'none',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
design: {
|
|
41
|
+
type: 'figma',
|
|
42
|
+
url: 'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/ROH:-Design-System-and-Documentation?node-id=3%3A1497',
|
|
43
|
+
},
|
|
44
|
+
jest: ['PrimaryButton', 'SecondaryButton', 'TertiaryButton'],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default meta;
|
|
49
|
+
|
|
50
|
+
interface IStorybookTertiaryButtonProps {
|
|
51
|
+
text: string;
|
|
52
|
+
color?: Colors;
|
|
53
|
+
bgColor?: Colors;
|
|
54
|
+
iconName?: IconNameType;
|
|
55
|
+
onClick: MouseEventHandler<any>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const ButtonsTemplate: Story<IStorybookTertiaryButtonProps> = (args) => (
|
|
59
|
+
<div style={{ display: 'flex', gap: '10px' }}>
|
|
60
|
+
<PrimaryButton {...args}>{args.text}</PrimaryButton>
|
|
61
|
+
<SecondaryButton {...args}>{args.text}</SecondaryButton>
|
|
62
|
+
<TertiaryButton {...args}>{args.text}</TertiaryButton>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
export const ButtonsWithIcon = ButtonsTemplate.bind({});
|
|
67
|
+
ButtonsWithIcon.args = {
|
|
68
|
+
onClick: () => console.log('click!'),
|
|
69
|
+
text: 'Button Text',
|
|
70
|
+
iconName: 'Arrow',
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const ButtonsWithNoIcon = ButtonsTemplate.bind({});
|
|
74
|
+
ButtonsWithNoIcon.args = {
|
|
75
|
+
onClick: () => console.log('click!'),
|
|
76
|
+
text: 'Button Text',
|
|
77
|
+
};
|