@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,94 @@
|
|
|
1
|
+
import React, { MouseEventHandler } from 'react';
|
|
2
|
+
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import PrimaryButton from './PrimaryButton';
|
|
4
|
+
import GlobalStyles from '../../../../styles/GlobalStyles';
|
|
5
|
+
import ThemeProvider from '../../../../styles/ThemeProvider';
|
|
6
|
+
import { ThemeType, Colors } from '../../../../types/types';
|
|
7
|
+
import { DirectionType, IconNameType } from '../../../../types/iconTypes';
|
|
8
|
+
|
|
9
|
+
const meta: Meta = {
|
|
10
|
+
title: 'Components/Foundations/Buttons/Primary',
|
|
11
|
+
component: PrimaryButton,
|
|
12
|
+
argTypes: {
|
|
13
|
+
color: {
|
|
14
|
+
description: 'Text and icon color',
|
|
15
|
+
},
|
|
16
|
+
bgColor: {
|
|
17
|
+
description: 'Background color',
|
|
18
|
+
},
|
|
19
|
+
iconName: {
|
|
20
|
+
description: 'Name of the icon to be displayed',
|
|
21
|
+
},
|
|
22
|
+
iconDirection: {
|
|
23
|
+
description: 'Direction of the icon to be displayed',
|
|
24
|
+
},
|
|
25
|
+
ref: {
|
|
26
|
+
table: { disable: true },
|
|
27
|
+
},
|
|
28
|
+
theme: {
|
|
29
|
+
table: { disable: true },
|
|
30
|
+
},
|
|
31
|
+
as: {
|
|
32
|
+
table: { disable: true },
|
|
33
|
+
},
|
|
34
|
+
forwardedAs: {
|
|
35
|
+
table: { disable: true },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
decorators: [
|
|
39
|
+
(Story) => (
|
|
40
|
+
<ThemeProvider theme={ThemeType.Core}>
|
|
41
|
+
<GlobalStyles />
|
|
42
|
+
{Story()}
|
|
43
|
+
</ThemeProvider>
|
|
44
|
+
),
|
|
45
|
+
],
|
|
46
|
+
parameters: {
|
|
47
|
+
docs: {
|
|
48
|
+
description: {
|
|
49
|
+
component: 'Primary button',
|
|
50
|
+
withSource: 'none',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
design: {
|
|
54
|
+
type: 'figma',
|
|
55
|
+
url: 'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/ROH:-Design-System-and-Documentation?node-id=3%3A1497',
|
|
56
|
+
},
|
|
57
|
+
jest: ['PrimaryButton'],
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default meta;
|
|
62
|
+
|
|
63
|
+
interface IStorybookPrimaryButtonProps {
|
|
64
|
+
text: string;
|
|
65
|
+
color?: Colors;
|
|
66
|
+
bgColor?: Colors;
|
|
67
|
+
iconName?: IconNameType;
|
|
68
|
+
iconDirection?: DirectionType;
|
|
69
|
+
onClick: MouseEventHandler<any>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const PrimaryButtonTemplate: Story<IStorybookPrimaryButtonProps> = (args) => (
|
|
73
|
+
<PrimaryButton {...args}>{args.text}</PrimaryButton>
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
export const ButtonWithNoIcon = PrimaryButtonTemplate.bind({});
|
|
77
|
+
ButtonWithNoIcon.args = {
|
|
78
|
+
onClick: () => console.log('click!'),
|
|
79
|
+
text: 'Button Text',
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const ButtonWithIcon = PrimaryButtonTemplate.bind({});
|
|
83
|
+
ButtonWithIcon.args = {
|
|
84
|
+
onClick: () => console.log('click!'),
|
|
85
|
+
iconName: 'BookTickets',
|
|
86
|
+
text: 'Button Text',
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const ButtonWithLongText = PrimaryButtonTemplate.bind({});
|
|
90
|
+
ButtonWithLongText.args = {
|
|
91
|
+
onClick: () => console.log('click!'),
|
|
92
|
+
iconName: 'BookTickets',
|
|
93
|
+
text: 'Very Very Long Button Truncated Text',
|
|
94
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, within, fireEvent } from '@testing-library/react';
|
|
3
|
+
import PrimaryButton from './PrimaryButton';
|
|
4
|
+
|
|
5
|
+
describe('PrimaryButton component', () => {
|
|
6
|
+
const onClick = jest.fn();
|
|
7
|
+
it('renders button with specific text', () => {
|
|
8
|
+
const { getByText } = render(<PrimaryButton onClick={onClick}>Primary button text</PrimaryButton>);
|
|
9
|
+
|
|
10
|
+
expect(getByText('Primary button text')).toBeInTheDocument();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('truncates button text if its length is greater than 30 characters', () => {
|
|
14
|
+
const { getByText, queryAllByText } = render(
|
|
15
|
+
<PrimaryButton onClick={onClick}>Very Very Long Primary button text</PrimaryButton>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
expect(queryAllByText('Very Very Long Primary button text')).toHaveLength(0);
|
|
19
|
+
expect(getByText('Very Very Long Primary button')).toBeInTheDocument();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('renders icon inside the button', () => {
|
|
23
|
+
const { getByText } = render(
|
|
24
|
+
<PrimaryButton iconName="Arrow" onClick={onClick}>
|
|
25
|
+
Primary button text
|
|
26
|
+
</PrimaryButton>
|
|
27
|
+
);
|
|
28
|
+
const button = getByText('Primary button text');
|
|
29
|
+
|
|
30
|
+
expect(within(button).getByTestId('button-icon')).toBeInTheDocument();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('calls onClick callback when button is clicked', () => {
|
|
34
|
+
const { getByText } = render(<PrimaryButton onClick={onClick}>Primary button text</PrimaryButton>);
|
|
35
|
+
|
|
36
|
+
fireEvent.click(getByText('Primary button text'));
|
|
37
|
+
expect(onClick).toBeCalled();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import PrimaryButtonWrapper from './PrimaryButtonWrapper.style';
|
|
3
|
+
import { Colors } from '../../../../types/types';
|
|
4
|
+
import { IPrimaryButtonProps } from '../../../../types/buttonTypes';
|
|
5
|
+
|
|
6
|
+
const PrimaryButton: FunctionComponent<IPrimaryButtonProps> = ({ children, ...props }) => {
|
|
7
|
+
return (
|
|
8
|
+
<PrimaryButtonWrapper color={Colors.White} {...props}>
|
|
9
|
+
{children}
|
|
10
|
+
</PrimaryButtonWrapper>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default PrimaryButton;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import Button from '../Button';
|
|
3
|
+
import { IPrimaryButtonProps } from '../../../../types/buttonTypes';
|
|
4
|
+
import { Colors } from '../../../../types/types';
|
|
5
|
+
|
|
6
|
+
const PrimaryButtonWrapper = styled(Button)<IPrimaryButtonProps>`
|
|
7
|
+
background-color: var(--base-color-${({ bgColor = Colors.Primary }) => bgColor});
|
|
8
|
+
border-color: var(--base-color-${({ bgColor = Colors.Primary }) => bgColor});
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
export default PrimaryButtonWrapper;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React, { MouseEventHandler } from 'react';
|
|
2
|
+
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import SecondaryButton from './SecondaryButton';
|
|
4
|
+
import GlobalStyles from '../../../../styles/GlobalStyles';
|
|
5
|
+
import ThemeProvider from '../../../../styles/ThemeProvider';
|
|
6
|
+
import { ThemeType, Colors } from '../../../../types/types';
|
|
7
|
+
import { DirectionType, IconNameType } from '../../../../types/iconTypes';
|
|
8
|
+
|
|
9
|
+
const meta: Meta = {
|
|
10
|
+
title: 'Components/Foundations/Buttons/Secondary',
|
|
11
|
+
component: SecondaryButton,
|
|
12
|
+
argTypes: {
|
|
13
|
+
color: {
|
|
14
|
+
description: 'Text and border color',
|
|
15
|
+
},
|
|
16
|
+
ref: {
|
|
17
|
+
table: { disable: true },
|
|
18
|
+
},
|
|
19
|
+
theme: {
|
|
20
|
+
table: { disable: true },
|
|
21
|
+
},
|
|
22
|
+
as: {
|
|
23
|
+
table: { disable: true },
|
|
24
|
+
},
|
|
25
|
+
forwardedAs: {
|
|
26
|
+
table: { disable: true },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
decorators: [
|
|
30
|
+
(Story) => (
|
|
31
|
+
<ThemeProvider theme={ThemeType.Core}>
|
|
32
|
+
<GlobalStyles />
|
|
33
|
+
{Story()}
|
|
34
|
+
</ThemeProvider>
|
|
35
|
+
),
|
|
36
|
+
],
|
|
37
|
+
parameters: {
|
|
38
|
+
docs: {
|
|
39
|
+
description: {
|
|
40
|
+
component: 'Secondary button',
|
|
41
|
+
withSource: 'none',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
design: {
|
|
45
|
+
type: 'figma',
|
|
46
|
+
url: 'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/ROH:-Design-System-and-Documentation?node-id=3%3A1497',
|
|
47
|
+
},
|
|
48
|
+
jest: ['SecondaryButton'],
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default meta;
|
|
53
|
+
|
|
54
|
+
interface IStorybookSecondaryButtonProps {
|
|
55
|
+
text: string;
|
|
56
|
+
color?: Colors;
|
|
57
|
+
iconName?: IconNameType;
|
|
58
|
+
iconDirection?: DirectionType;
|
|
59
|
+
onClick: MouseEventHandler<any>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const SecondaryButtonTemplate: Story<IStorybookSecondaryButtonProps> = (args) => (
|
|
63
|
+
<SecondaryButton {...args}>{args.text}</SecondaryButton>
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
export const ButtonWithNoIcon = SecondaryButtonTemplate.bind({});
|
|
67
|
+
ButtonWithNoIcon.args = {
|
|
68
|
+
onClick: () => console.log('click!'),
|
|
69
|
+
text: 'Button Text',
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const ButtonWithIcon = SecondaryButtonTemplate.bind({});
|
|
73
|
+
ButtonWithIcon.args = {
|
|
74
|
+
onClick: () => console.log('click!'),
|
|
75
|
+
iconName: 'BookTickets',
|
|
76
|
+
text: 'Button Text',
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const ButtonWithLongText = SecondaryButtonTemplate.bind({});
|
|
80
|
+
ButtonWithLongText.args = {
|
|
81
|
+
onClick: () => console.log('click!'),
|
|
82
|
+
iconName: 'BookTickets',
|
|
83
|
+
text: 'Very Very Long Button Truncated Text',
|
|
84
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, within, fireEvent } from '@testing-library/react';
|
|
3
|
+
import SecondaryButton from './SecondaryButton';
|
|
4
|
+
|
|
5
|
+
describe('SecondaryButton component', () => {
|
|
6
|
+
const onClick = jest.fn();
|
|
7
|
+
it('renders button with specific text', () => {
|
|
8
|
+
const { getByText } = render(<SecondaryButton onClick={onClick}>Secondary button text</SecondaryButton>);
|
|
9
|
+
|
|
10
|
+
expect(getByText('Secondary button text')).toBeInTheDocument();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('truncates button text if its length is greater than 30 characters', () => {
|
|
14
|
+
const { getByText, queryAllByText } = render(
|
|
15
|
+
<SecondaryButton onClick={onClick}>Very Very Long Secondary button text</SecondaryButton>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
expect(queryAllByText('Very Very Long Secondary button text')).toHaveLength(0);
|
|
19
|
+
expect(getByText('Very Very Long Secondary butto')).toBeInTheDocument();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('renders icon inside the button', () => {
|
|
23
|
+
const { getByText } = render(
|
|
24
|
+
<SecondaryButton iconName="Arrow" onClick={onClick}>
|
|
25
|
+
Secondary button text
|
|
26
|
+
</SecondaryButton>
|
|
27
|
+
);
|
|
28
|
+
const button = getByText('Secondary button text');
|
|
29
|
+
|
|
30
|
+
expect(within(button).getByTestId('button-icon')).toBeInTheDocument();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('calls onClick callback when button is clicked', () => {
|
|
34
|
+
const { getByText } = render(<SecondaryButton onClick={onClick}>Secondary button text</SecondaryButton>);
|
|
35
|
+
|
|
36
|
+
fireEvent.click(getByText('Secondary button text'));
|
|
37
|
+
expect(onClick).toBeCalled();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import SecondaryButtonWrapper from './SecondaryButtonWrapper.style';
|
|
3
|
+
import { Colors } from '../../../../types/types';
|
|
4
|
+
import { IButtonProps } from '../../../../types/buttonTypes';
|
|
5
|
+
|
|
6
|
+
const SecondaryButton: FunctionComponent<IButtonProps> = ({ children, ...props }) => {
|
|
7
|
+
return (
|
|
8
|
+
<SecondaryButtonWrapper color={Colors.Primary} {...props}>
|
|
9
|
+
{children}
|
|
10
|
+
</SecondaryButtonWrapper>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default SecondaryButton;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import Button from '../Button';
|
|
3
|
+
import { IButtonProps } from '../../../../types/buttonTypes';
|
|
4
|
+
import { Colors } from '../../../../types/types';
|
|
5
|
+
|
|
6
|
+
const PrimaryButtonWrapper = styled(Button)<IButtonProps>`
|
|
7
|
+
background-color: var(--base-color-transparent);
|
|
8
|
+
border-color: var(--base-color-${({ color = Colors.Primary }) => color});
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
export default PrimaryButtonWrapper;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React, { MouseEventHandler } from 'react';
|
|
2
|
+
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import TertiaryButton from './TertiaryButton';
|
|
4
|
+
import GlobalStyles from '../../../../styles/GlobalStyles';
|
|
5
|
+
import ThemeProvider from '../../../../styles/ThemeProvider';
|
|
6
|
+
import { ThemeType, Colors } from '../../../../types/types';
|
|
7
|
+
|
|
8
|
+
const meta: Meta = {
|
|
9
|
+
title: 'Components/Foundations/Buttons/Tertiary',
|
|
10
|
+
component: TertiaryButton,
|
|
11
|
+
argTypes: {
|
|
12
|
+
color: {
|
|
13
|
+
description: 'Text and icon color',
|
|
14
|
+
},
|
|
15
|
+
ref: {
|
|
16
|
+
table: { disable: true },
|
|
17
|
+
},
|
|
18
|
+
theme: {
|
|
19
|
+
table: { disable: true },
|
|
20
|
+
},
|
|
21
|
+
as: {
|
|
22
|
+
table: { disable: true },
|
|
23
|
+
},
|
|
24
|
+
forwardedAs: {
|
|
25
|
+
table: { disable: true },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
decorators: [
|
|
29
|
+
(Story) => (
|
|
30
|
+
<ThemeProvider theme={ThemeType.Core}>
|
|
31
|
+
<GlobalStyles />
|
|
32
|
+
{Story()}
|
|
33
|
+
</ThemeProvider>
|
|
34
|
+
),
|
|
35
|
+
],
|
|
36
|
+
parameters: {
|
|
37
|
+
docs: {
|
|
38
|
+
description: {
|
|
39
|
+
component: 'Tertiary button',
|
|
40
|
+
withSource: 'none',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
design: {
|
|
44
|
+
type: 'figma',
|
|
45
|
+
url: 'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/ROH:-Design-System-and-Documentation?node-id=3%3A1497',
|
|
46
|
+
},
|
|
47
|
+
jest: ['TertiaryButton'],
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default meta;
|
|
52
|
+
|
|
53
|
+
interface IStorybookTertiaryButtonProps {
|
|
54
|
+
text: string;
|
|
55
|
+
color?: Colors;
|
|
56
|
+
onClick: MouseEventHandler<any>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const TertiaryButtonTemplate: Story<IStorybookTertiaryButtonProps> = (args) => (
|
|
60
|
+
<TertiaryButton {...args}>{args.text}</TertiaryButton>
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export const Button = TertiaryButtonTemplate.bind({});
|
|
64
|
+
Button.args = {
|
|
65
|
+
onClick: () => console.log('click!'),
|
|
66
|
+
text: 'Button Text',
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const ButtonWithLongText = TertiaryButtonTemplate.bind({});
|
|
70
|
+
ButtonWithLongText.args = {
|
|
71
|
+
onClick: () => console.log('click!'),
|
|
72
|
+
text: 'Very Very Long Button Truncated Text',
|
|
73
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { ITertiaryButtonProps } from '../../../../types/buttonTypes';
|
|
3
|
+
|
|
4
|
+
const TertiaryButtonWrapper = styled.a<ITertiaryButtonProps>`
|
|
5
|
+
padding: 0;
|
|
6
|
+
height: var(--button-height);
|
|
7
|
+
font-family: var(--font-family-buttons);
|
|
8
|
+
font-size: var(--button-font-size);
|
|
9
|
+
font-weight: var(--button-font-weight);
|
|
10
|
+
color: var(--base-color-${({ color }) => color});
|
|
11
|
+
width: fit-content;
|
|
12
|
+
background: none;
|
|
13
|
+
border-style: none;
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
text-decoration: none;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
const TertiaryIconWrapper = styled.span`
|
|
23
|
+
width: var(--button-icon-width);
|
|
24
|
+
height: var(--button-icon-height);
|
|
25
|
+
margin-left: var(--button-icon-margin);
|
|
26
|
+
display: inline-block;
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
export { TertiaryIconWrapper, TertiaryButtonWrapper };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, within, fireEvent } from '@testing-library/react';
|
|
3
|
+
import TertiaryButton from './TertiaryButton';
|
|
4
|
+
|
|
5
|
+
describe('TertiaryButton component', () => {
|
|
6
|
+
const onClick = jest.fn();
|
|
7
|
+
it('renders button with specific text with icon', () => {
|
|
8
|
+
const { getByText } = render(<TertiaryButton onClick={onClick}>Tertiary button text</TertiaryButton>);
|
|
9
|
+
const button = getByText('Tertiary button text');
|
|
10
|
+
expect(button).toBeInTheDocument();
|
|
11
|
+
expect(within(button).getByTestId('tertiary-icon')).toBeInTheDocument();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('truncates button text if its length is greater than 30 characters', () => {
|
|
15
|
+
const { getByText, queryAllByText } = render(
|
|
16
|
+
<TertiaryButton onClick={onClick}>Very Very Long Tertiary button text</TertiaryButton>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
expect(queryAllByText('Very Very Long Tertiary button text')).toHaveLength(0);
|
|
20
|
+
expect(getByText('Very Very Long Tertiary button')).toBeInTheDocument();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('calls onClick callback when button is clicked', () => {
|
|
24
|
+
const { getByText } = render(<TertiaryButton onClick={onClick}>Tertiary button text</TertiaryButton>);
|
|
25
|
+
|
|
26
|
+
fireEvent.click(getByText('Tertiary button text'));
|
|
27
|
+
expect(onClick).toBeCalled();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import { TertiaryButtonWrapper, TertiaryIconWrapper } from './TertiaryButton.style';
|
|
3
|
+
import { Icon } from '../../Icons';
|
|
4
|
+
import { IButtonProps } from '../../../../types/buttonTypes';
|
|
5
|
+
|
|
6
|
+
const Button: FunctionComponent<IButtonProps> = ({ children, color, ...rest }) => {
|
|
7
|
+
const truncatedString = (children as string).substring(0, 30);
|
|
8
|
+
return (
|
|
9
|
+
<TertiaryButtonWrapper {...rest} color={color}>
|
|
10
|
+
{truncatedString}
|
|
11
|
+
<TertiaryIconWrapper data-testid="tertiary-icon">
|
|
12
|
+
<Icon iconName="Arrow" color={color} />
|
|
13
|
+
</TertiaryIconWrapper>
|
|
14
|
+
</TertiaryButtonWrapper>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default Button;
|
|
@@ -0,0 +1,153 @@
|
|
|
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 Dropdown from './index';
|
|
6
|
+
import { IDropdownProps, ThemeType } from '../../../types/types';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Components/Dropdown',
|
|
10
|
+
component: Dropdown,
|
|
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
|
+
parameters: {
|
|
26
|
+
docs: {
|
|
27
|
+
description: {
|
|
28
|
+
component: 'Dropdown component',
|
|
29
|
+
withSource: 'none',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
design: {
|
|
33
|
+
type: 'figma',
|
|
34
|
+
url: 'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/Royal-Opera-House-UI-Guide-and-Spec?node-id=166%3A0',
|
|
35
|
+
},
|
|
36
|
+
jest: ['Dropdown'],
|
|
37
|
+
},
|
|
38
|
+
decorators: [
|
|
39
|
+
(Story) => (
|
|
40
|
+
<ThemeProvider theme={ThemeType.Core}>
|
|
41
|
+
<GlobalStyles />
|
|
42
|
+
{Story()}
|
|
43
|
+
</ThemeProvider>
|
|
44
|
+
),
|
|
45
|
+
],
|
|
46
|
+
} as Meta;
|
|
47
|
+
|
|
48
|
+
const Template: Story<IDropdownProps> = (args) => <Dropdown {...args} />;
|
|
49
|
+
|
|
50
|
+
export const DropdownWithTextOnly = Template.bind({});
|
|
51
|
+
|
|
52
|
+
DropdownWithTextOnly.args = {
|
|
53
|
+
title: 'TEXT',
|
|
54
|
+
withIcon: 'none',
|
|
55
|
+
selected: false,
|
|
56
|
+
onChange: () => {},
|
|
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 DropdownWithIconRight = Template.bind({});
|
|
74
|
+
|
|
75
|
+
DropdownWithIconRight.args = {
|
|
76
|
+
iconName: 'DropdownArrow',
|
|
77
|
+
withIcon: 'right',
|
|
78
|
+
title: 'TEXT',
|
|
79
|
+
selected: false,
|
|
80
|
+
onChange: () => {},
|
|
81
|
+
options: [
|
|
82
|
+
{
|
|
83
|
+
option: 'OPTION 1',
|
|
84
|
+
optionLink: 'link 1',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
option: 'OPTION 2',
|
|
88
|
+
optionLink: 'link 2',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
option: 'OPTION 3',
|
|
92
|
+
optionLink: 'link 3',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const DropdownWithIconLeft = Template.bind({});
|
|
98
|
+
|
|
99
|
+
DropdownWithIconLeft.args = {
|
|
100
|
+
iconName: 'DropdownArrow',
|
|
101
|
+
withIcon: 'left',
|
|
102
|
+
title: 'TEXT',
|
|
103
|
+
selected: false,
|
|
104
|
+
onChange: () => {},
|
|
105
|
+
options: [
|
|
106
|
+
{
|
|
107
|
+
option: 'OPTION 1',
|
|
108
|
+
optionLink: 'link 1',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
option: 'OPTION 2',
|
|
112
|
+
optionLink: 'link 2',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
option: 'OPTION 3',
|
|
116
|
+
optionLink: 'link 3',
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const DropdownWithoutOptions = Template.bind({});
|
|
122
|
+
|
|
123
|
+
DropdownWithoutOptions.args = {
|
|
124
|
+
title: 'TEXT',
|
|
125
|
+
withIcon: 'none',
|
|
126
|
+
selected: false,
|
|
127
|
+
onChange: () => {},
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export const DropdownWithoutOptionsInMobile = Template.bind({});
|
|
131
|
+
|
|
132
|
+
DropdownWithoutOptionsInMobile.args = {
|
|
133
|
+
iconName: 'DropdownArrow',
|
|
134
|
+
withOptionsInMobile: false,
|
|
135
|
+
title: 'TEXT',
|
|
136
|
+
titleLink: 'foo',
|
|
137
|
+
selected: false,
|
|
138
|
+
onChange: () => {},
|
|
139
|
+
options: [
|
|
140
|
+
{
|
|
141
|
+
option: 'OPTION 1',
|
|
142
|
+
optionLink: 'link 1',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
option: 'OPTION 2',
|
|
146
|
+
optionLink: 'link 2',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
option: 'OPTION 3',
|
|
150
|
+
optionLink: 'link 3',
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { devices } from '../../../styles/viewports';
|
|
3
|
+
import { IDropdownProps } from '../../../types/types';
|
|
4
|
+
|
|
5
|
+
export const TabContainer = styled.div`
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
position: relative;
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
export const OptionItem = styled.a`
|
|
12
|
+
font-size: var(--font-size-navigation);
|
|
13
|
+
font-family: var(--font-family-navigation);
|
|
14
|
+
color: var(--base-color-black);
|
|
15
|
+
text-decoration: none;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
text-transform: uppercase;
|
|
18
|
+
|
|
19
|
+
:hover {
|
|
20
|
+
color: var(--base-color-primary);
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
export const OptionsContainer = styled.div<IDropdownProps>`
|
|
25
|
+
background-color: var(--base-color-white);
|
|
26
|
+
border: 1px solid var(--base-color-light-grey);
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
row-gap: var(--navigation-small-gap);
|
|
30
|
+
padding: var(--navigation-middle-gap);
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 25px;
|
|
33
|
+
width: max-content;
|
|
34
|
+
z-index: 10;
|
|
35
|
+
|
|
36
|
+
${(props) => {
|
|
37
|
+
if (props.withIcon === 'none') {
|
|
38
|
+
return `
|
|
39
|
+
top: 21px;
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
return ``;
|
|
43
|
+
}}
|
|
44
|
+
|
|
45
|
+
@media ${devices.mobileAndTablet} {
|
|
46
|
+
padding-left: 0px;
|
|
47
|
+
padding-bottom: 0px;
|
|
48
|
+
row-gap: var(--navigation-large-gap);
|
|
49
|
+
border: 0;
|
|
50
|
+
background-color: none;
|
|
51
|
+
|
|
52
|
+
${(props) => {
|
|
53
|
+
if (props.withOptionsInMobile) {
|
|
54
|
+
return `
|
|
55
|
+
position: relative;
|
|
56
|
+
top: 0px;
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
return `
|
|
60
|
+
display: none;
|
|
61
|
+
`;
|
|
62
|
+
}}
|
|
63
|
+
}
|
|
64
|
+
`;
|