@royaloperahouse/chord 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/chord.cjs.development.js +567 -278
- package/dist/chord.cjs.development.js.map +1 -1
- package/dist/chord.cjs.production.min.js +1 -1
- package/dist/chord.cjs.production.min.js.map +1 -1
- package/dist/chord.esm.js +567 -279
- package/dist/chord.esm.js.map +1 -1
- package/dist/components/atoms/Account/Account.d.ts +1 -1
- package/dist/components/atoms/Basket/Basket.d.ts +1 -1
- package/dist/components/atoms/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/atoms/Dropdown/Dropdown.style.d.ts +1 -1
- package/dist/components/atoms/Icons/SvgIcons/index.d.ts +0 -1
- package/dist/components/atoms/Logo/Logo.d.ts +1 -1
- package/dist/components/atoms/Search/Search.d.ts +1 -1
- package/dist/components/atoms/SponsorLogo/SponsorLogo.d.ts +4 -0
- package/dist/components/atoms/SponsorLogo/SponsorLogo.style.d.ts +1 -0
- package/dist/components/atoms/SponsorLogo/index.d.ts +2 -0
- package/dist/components/atoms/Tab/Tab.d.ts +1 -1
- package/dist/components/atoms/index.d.ts +2 -1
- package/dist/components/molecules/NavTop/NavTop.d.ts +1 -1
- package/dist/components/molecules/Tabs/Tabs.d.ts +1 -1
- package/dist/components/molecules/Tabs/Tabs.style.d.ts +1 -1
- package/dist/components/organisms/Navigation/Navigation.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/styles/themes.d.ts +6 -0
- package/dist/types/navigation.d.ts +24 -0
- package/dist/types/types.d.ts +24 -2
- package/package.json +10 -6
- package/dist/components/atoms/Icons/SvgIcons/Logos/Sponsors/Sponsor.svg.d.ts +0 -4
- package/dist/components/atoms/Image/Image.d.ts +0 -38
- package/src/components/atoms/Account/Account.stories.tsx +0 -93
- package/src/components/atoms/Account/Account.test.tsx +0 -54
- package/src/components/atoms/Account/Account.tsx +0 -25
- package/src/components/atoms/Account/index.tsx +0 -3
- package/src/components/atoms/Basket/Basket.stories.tsx +0 -79
- package/src/components/atoms/Basket/Basket.style.tsx +0 -74
- package/src/components/atoms/Basket/Basket.test.tsx +0 -35
- package/src/components/atoms/Basket/Basket.tsx +0 -34
- package/src/components/atoms/Basket/index.tsx +0 -3
- package/src/components/atoms/Buttons/Button.style.tsx +0 -31
- package/src/components/atoms/Buttons/Button.tsx +0 -21
- package/src/components/atoms/Buttons/ButtonIconWrapper.style.tsx +0 -10
- package/src/components/atoms/Buttons/Buttons.stories.tsx +0 -77
- package/src/components/atoms/Buttons/Primary/PrimaryButton.stories.tsx +0 -94
- package/src/components/atoms/Buttons/Primary/PrimaryButton.test.tsx +0 -39
- package/src/components/atoms/Buttons/Primary/PrimaryButton.tsx +0 -14
- package/src/components/atoms/Buttons/Primary/PrimaryButtonWrapper.style.tsx +0 -11
- package/src/components/atoms/Buttons/Secondary/SecondaryButton.stories.tsx +0 -84
- package/src/components/atoms/Buttons/Secondary/SecondaryButton.test.tsx +0 -39
- package/src/components/atoms/Buttons/Secondary/SecondaryButton.tsx +0 -14
- package/src/components/atoms/Buttons/Secondary/SecondaryButtonWrapper.style.tsx +0 -11
- package/src/components/atoms/Buttons/Tertiary/TertiaryButton.stories.tsx +0 -73
- package/src/components/atoms/Buttons/Tertiary/TertiaryButton.style.tsx +0 -29
- package/src/components/atoms/Buttons/Tertiary/TertiaryButton.test.tsx +0 -29
- package/src/components/atoms/Buttons/Tertiary/TertiaryButton.tsx +0 -18
- package/src/components/atoms/Buttons/index.tsx +0 -5
- package/src/components/atoms/Dropdown/Dropdown.stories.tsx +0 -153
- package/src/components/atoms/Dropdown/Dropdown.style.tsx +0 -64
- package/src/components/atoms/Dropdown/Dropdown.test.tsx +0 -67
- package/src/components/atoms/Dropdown/Dropdown.tsx +0 -131
- package/src/components/atoms/Dropdown/index.tsx +0 -3
- package/src/components/atoms/Grid/Grid.stories.tsx +0 -127
- package/src/components/atoms/Grid/Grid.test.tsx +0 -17
- package/src/components/atoms/Grid/Grid.tsx +0 -11
- package/src/components/atoms/Grid/GridItem.test.tsx +0 -25
- package/src/components/atoms/Grid/GridItem.tsx +0 -24
- package/src/components/atoms/Grid/index.tsx +0 -3
- package/src/components/atoms/Heading/Heading.stories.tsx +0 -44
- package/src/components/atoms/Heading/Heading.style.tsx +0 -14
- package/src/components/atoms/Heading/Heading.test.tsx +0 -13
- package/src/components/atoms/Heading/Heading.tsx +0 -15
- package/src/components/atoms/Heading/index.tsx +0 -3
- package/src/components/atoms/Icons/Icons.stories.tsx +0 -190
- package/src/components/atoms/Icons/Icons.style.tsx +0 -24
- package/src/components/atoms/Icons/Icons.test.tsx +0 -31
- package/src/components/atoms/Icons/Icons.tsx +0 -20
- package/src/components/atoms/Icons/StorybookSupport/Iconography.tsx +0 -27
- package/src/components/atoms/Icons/StorybookSupport/IconsDiv.style.tsx +0 -49
- package/src/components/atoms/Icons/SvgIcons/12px/Remove.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/12px/Tick.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Actions/AddToMyList.svg.tsx +0 -13
- package/src/components/atoms/Icons/SvgIcons/Actions/BookTickets.svg.tsx +0 -20
- package/src/components/atoms/Icons/SvgIcons/Actions/ChooseDates.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Actions/EditMyList.svg.tsx +0 -16
- package/src/components/atoms/Icons/SvgIcons/Actions/Filter.svg.tsx +0 -19
- package/src/components/atoms/Icons/SvgIcons/Actions/FindAScreening.svg.tsx +0 -31
- package/src/components/atoms/Icons/SvgIcons/Actions/OnMyList.svg.tsx +0 -16
- package/src/components/atoms/Icons/SvgIcons/Actions/Reminder.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Actions/Subscribe.svg.tsx +0 -9
- package/src/components/atoms/Icons/SvgIcons/Actions/Watch.svg.tsx +0 -9
- package/src/components/atoms/Icons/SvgIcons/Arrows/Arrow.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Arrows/CarouselArrow.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Arrows/DropdownArrow.svg.tsx +0 -8
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Cinema.svg.tsx +0 -31
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Clock.svg.tsx +0 -15
- package/src/components/atoms/Icons/SvgIcons/Descriptors/CreditCard.svg.tsx +0 -19
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Email.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Info.svg.tsx +0 -13
- package/src/components/atoms/Icons/SvgIcons/Descriptors/List.svg.tsx +0 -22
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Location.svg.tsx +0 -15
- package/src/components/atoms/Icons/SvgIcons/Descriptors/PDF.svg.tsx +0 -20
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Phone.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Print.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Secure.svg.tsx +0 -15
- package/src/components/atoms/Icons/SvgIcons/Descriptors/Tickets.svg.tsx +0 -13
- package/src/components/atoms/Icons/SvgIcons/Logos/Social/Facebook.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Logos/Social/Instagram.svg.tsx +0 -19
- package/src/components/atoms/Icons/SvgIcons/Logos/Social/Tiktok.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Logos/Social/Twitter.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Logos/Social/Youtube.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Logos/Sponsors/Sponsor.svg.tsx +0 -26
- package/src/components/atoms/Icons/SvgIcons/Navigation/BalletAndDance.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Navigation/Basket.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Navigation/BasketFull.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Navigation/Home.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Navigation/LiveStream.svg.tsx +0 -24
- package/src/components/atoms/Icons/SvgIcons/Navigation/Menu.svg.tsx +0 -10
- package/src/components/atoms/Icons/SvgIcons/Navigation/OperaAndMusic.svg.tsx +0 -17
- package/src/components/atoms/Icons/SvgIcons/Navigation/Search.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Navigation/Settings.svg.tsx +0 -15
- package/src/components/atoms/Icons/SvgIcons/Navigation/User.svg.tsx +0 -15
- package/src/components/atoms/Icons/SvgIcons/Navigation/UserSignedIn.svg.tsx +0 -12
- package/src/components/atoms/Icons/SvgIcons/Text/Delete.svg.tsx +0 -12
- package/src/components/atoms/Icons/SvgIcons/Text/Shift.svg.tsx +0 -8
- package/src/components/atoms/Icons/SvgIcons/Text/Space.svg.tsx +0 -8
- package/src/components/atoms/Icons/SvgIcons/Utility/Close.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Utility/Confirm.svg.tsx +0 -8
- package/src/components/atoms/Icons/SvgIcons/Utility/Detract.svg.tsx +0 -8
- package/src/components/atoms/Icons/SvgIcons/Utility/Expand.svg.tsx +0 -8
- package/src/components/atoms/Icons/SvgIcons/Utility/ExternalLink.svg.tsx +0 -12
- package/src/components/atoms/Icons/SvgIcons/Utility/GridView.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Utility/ListView.svg.tsx +0 -10
- package/src/components/atoms/Icons/SvgIcons/Utility/Refresh.svg.tsx +0 -15
- package/src/components/atoms/Icons/SvgIcons/Video/AudioDescription.svg.tsx +0 -16
- package/src/components/atoms/Icons/SvgIcons/Video/Back10.svg.tsx +0 -16
- package/src/components/atoms/Icons/SvgIcons/Video/Clips.svg.tsx +0 -10
- package/src/components/atoms/Icons/SvgIcons/Video/Forward10.svg.tsx +0 -16
- package/src/components/atoms/Icons/SvgIcons/Video/FullScreen.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Video/Minimise.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Video/Muted.svg.tsx +0 -15
- package/src/components/atoms/Icons/SvgIcons/Video/Pause.svg.tsx +0 -9
- package/src/components/atoms/Icons/SvgIcons/Video/Play.svg.tsx +0 -9
- package/src/components/atoms/Icons/SvgIcons/Video/Restart.svg.tsx +0 -11
- package/src/components/atoms/Icons/SvgIcons/Video/Subtitles.svg.tsx +0 -17
- package/src/components/atoms/Icons/SvgIcons/Video/Trailer.svg.tsx +0 -12
- package/src/components/atoms/Icons/SvgIcons/Video/Volume.svg.tsx +0 -19
- package/src/components/atoms/Icons/SvgIcons/index.tsx +0 -149
- package/src/components/atoms/Icons/__snapshots__/Icons.test.tsx.snap +0 -1954
- package/src/components/atoms/Icons/index.tsx +0 -2
- package/src/components/atoms/Image/Image.tsx +0 -72
- package/src/components/atoms/ImageAspectRatioWrapper/ImageAspectRatio.test.tsx +0 -23
- package/src/components/atoms/ImageAspectRatioWrapper/ImageAspectRatioWrapper.stories.tsx +0 -71
- package/src/components/atoms/ImageAspectRatioWrapper/ImageAspectRatioWrapper.tsx +0 -15
- package/src/components/atoms/ImageAspectRatioWrapper/index.tsx +0 -3
- package/src/components/atoms/IndividualListing/IndividualListing.stories.tsx +0 -51
- package/src/components/atoms/IndividualListing/IndividualListing.style.tsx +0 -33
- package/src/components/atoms/IndividualListing/IndividualListing.test.tsx +0 -30
- package/src/components/atoms/IndividualListing/IndividualListing.tsx +0 -22
- package/src/components/atoms/IndividualListing/index.tsx +0 -3
- package/src/components/atoms/Logo/Logo.stories.tsx +0 -48
- package/src/components/atoms/Logo/Logo.style.tsx +0 -18
- package/src/components/atoms/Logo/Logo.tsx +0 -30
- package/src/components/atoms/Logo/index.tsx +0 -3
- package/src/components/atoms/Search/Search.stories.tsx +0 -63
- package/src/components/atoms/Search/Search.style.tsx +0 -36
- package/src/components/atoms/Search/Search.test.tsx +0 -24
- package/src/components/atoms/Search/Search.tsx +0 -16
- package/src/components/atoms/Search/index.tsx +0 -3
- package/src/components/atoms/SectionSplitter/SectionSplitter.stories.tsx +0 -47
- package/src/components/atoms/SectionSplitter/SectionSplitter.style.tsx +0 -11
- package/src/components/atoms/SectionSplitter/SectionSplitter.tsx +0 -22
- package/src/components/atoms/SectionSplitter/index.tsx +0 -3
- package/src/components/atoms/Sponsorship/Sponsorship.stories.tsx +0 -38
- package/src/components/atoms/Sponsorship/Sponsorship.test.tsx +0 -36
- package/src/components/atoms/Sponsorship/Sponsorship.tsx +0 -53
- package/src/components/atoms/Sponsorship/index.tsx +0 -3
- package/src/components/atoms/Tab/Tab.stories.tsx +0 -67
- package/src/components/atoms/Tab/Tab.style.tsx +0 -105
- package/src/components/atoms/Tab/Tab.test.tsx +0 -28
- package/src/components/atoms/Tab/Tab.tsx +0 -34
- package/src/components/atoms/Tab/index.tsx +0 -3
- package/src/components/atoms/TextLink/TextLink.stories.tsx +0 -81
- package/src/components/atoms/TextLink/TextLink.style.tsx +0 -26
- package/src/components/atoms/TextLink/TextLink.test.tsx +0 -39
- package/src/components/atoms/TextLink/TextLink.tsx +0 -20
- package/src/components/atoms/TextLink/index.tsx +0 -3
- package/src/components/atoms/TypeTags/TypeTags.stories.tsx +0 -57
- package/src/components/atoms/TypeTags/TypeTags.style.tsx +0 -28
- package/src/components/atoms/TypeTags/TypeTags.test.tsx +0 -21
- package/src/components/atoms/TypeTags/TypeTags.tsx +0 -15
- package/src/components/atoms/TypeTags/index.tsx +0 -3
- package/src/components/atoms/index.tsx +0 -22
- package/src/components/index.tsx +0 -38
- package/src/components/molecules/ContactNewsletter/ContactNewsletter.style.tsx +0 -116
- package/src/components/molecules/ContactNewsletter/ContactNewsletter.test.tsx +0 -85
- package/src/components/molecules/ContactNewsletter/ContactNewsletter.tsx +0 -51
- package/src/components/molecules/ContactNewsletter/index.tsx +0 -3
- package/src/components/molecules/Editorial/Editorial.stories.tsx +0 -78
- package/src/components/molecules/Editorial/Editorial.style.tsx +0 -73
- package/src/components/molecules/Editorial/Editorial.test.tsx +0 -73
- package/src/components/molecules/Editorial/Editorial.tsx +0 -32
- package/src/components/molecules/Editorial/index.tsx +0 -3
- package/src/components/molecules/NavTop/NavTop.stories.tsx +0 -95
- package/src/components/molecules/NavTop/NavTop.style.tsx +0 -14
- package/src/components/molecules/NavTop/NavTop.test.tsx +0 -113
- package/src/components/molecules/NavTop/NavTop.tsx +0 -27
- package/src/components/molecules/NavTop/index.tsx +0 -3
- package/src/components/molecules/PeopleListing/PeopleListing.stories.tsx +0 -185
- package/src/components/molecules/PeopleListing/PeopleListing.style.tsx +0 -8
- package/src/components/molecules/PeopleListing/PeopleListing.test.tsx +0 -24
- package/src/components/molecules/PeopleListing/PeopleListing.tsx +0 -27
- package/src/components/molecules/PeopleListing/index.tsx +0 -3
- package/src/components/molecules/PolicyLinks/PolicyLinks.style.tsx +0 -41
- package/src/components/molecules/PolicyLinks/PolicyLinks.test.tsx +0 -28
- package/src/components/molecules/PolicyLinks/PolicyLinks.tsx +0 -19
- package/src/components/molecules/PolicyLinks/index.tsx +0 -3
- package/src/components/molecules/PromoWithTitle/PromoWithTitle.stories.tsx +0 -119
- package/src/components/molecules/PromoWithTitle/PromoWithTitle.style.tsx +0 -108
- package/src/components/molecules/PromoWithTitle/PromoWithTitle.test.tsx +0 -75
- package/src/components/molecules/PromoWithTitle/PromoWithTitle.tsx +0 -53
- package/src/components/molecules/PromoWithTitle/index.tsx +0 -3
- package/src/components/molecules/SearchBar/SearchBar.stories.tsx +0 -35
- package/src/components/molecules/SearchBar/SearchBar.style.tsx +0 -66
- package/src/components/molecules/SearchBar/SearchBar.test.tsx +0 -63
- package/src/components/molecules/SearchBar/SearchBar.tsx +0 -69
- package/src/components/molecules/SearchBar/index.tsx +0 -3
- package/src/components/molecules/SectionTitle/SectionTitle.stories.tsx +0 -68
- package/src/components/molecules/SectionTitle/SectionTitle.style.tsx +0 -34
- package/src/components/molecules/SectionTitle/SectionTitle.test.tsx +0 -35
- package/src/components/molecules/SectionTitle/SectionTitle.tsx +0 -25
- package/src/components/molecules/SectionTitle/index.tsx +0 -3
- package/src/components/molecules/Tabs/Tabs.stories.tsx +0 -101
- package/src/components/molecules/Tabs/Tabs.style.tsx +0 -74
- package/src/components/molecules/Tabs/Tabs.test.tsx +0 -149
- package/src/components/molecules/Tabs/Tabs.tsx +0 -67
- package/src/components/molecules/Tabs/index.tsx +0 -3
- package/src/components/molecules/TextOnly/TextOnly.stories.tsx +0 -74
- package/src/components/molecules/TextOnly/TextOnly.style.tsx +0 -56
- package/src/components/molecules/TextOnly/TextOnly.test.tsx +0 -79
- package/src/components/molecules/TextOnly/TextOnly.tsx +0 -16
- package/src/components/molecules/TextOnly/index.tsx +0 -3
- package/src/components/molecules/index.tsx +0 -7
- package/src/components/organisms/Footer/Footer.stories.tsx +0 -54
- package/src/components/organisms/Footer/Footer.style.tsx +0 -72
- package/src/components/organisms/Footer/Footer.test.tsx +0 -31
- package/src/components/organisms/Footer/Footer.tsx +0 -53
- package/src/components/organisms/Footer/exampleData.json +0 -78
- package/src/components/organisms/Footer/index.tsx +0 -3
- package/src/components/organisms/Navigation/Navigation.stories.tsx +0 -110
- package/src/components/organisms/Navigation/Navigation.style.tsx +0 -87
- package/src/components/organisms/Navigation/Navigation.test.tsx +0 -115
- package/src/components/organisms/Navigation/Navigation.tsx +0 -109
- package/src/components/organisms/Navigation/index.tsx +0 -3
- package/src/components/organisms/Navigation/menuData.json +0 -104
- package/src/components/organisms/index.tsx +0 -4
- package/src/index.tsx +0 -44
- package/src/jest.setup.ts +0 -1
- package/src/styles/GlobalStyles.tsx +0 -205
- package/src/styles/StorybookSupport/Colours/Colours.stories.mdx +0 -101
- package/src/styles/StorybookSupport/Colours/StorybookColourBox.tsx +0 -32
- package/src/styles/ThemeProvider.tsx +0 -11
- package/src/styles/themes.ts +0 -398
- package/src/styles/viewports.ts +0 -14
- package/src/types/buttonTypes.ts +0 -42
- package/src/types/editorial.ts +0 -84
- package/src/types/footer.ts +0 -49
- package/src/types/iconTypes.ts +0 -38
- package/src/types/image.ts +0 -13
- package/src/types/images.d.ts +0 -1
- package/src/types/index.tsx +0 -5
- package/src/types/navigation.ts +0 -149
- package/src/types/types.ts +0 -276
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Story, Meta } from '@storybook/react';
|
|
3
|
-
import GlobalStyles from '../../../styles/GlobalStyles';
|
|
4
|
-
import ThemeProvider from '../../../styles/ThemeProvider';
|
|
5
|
-
import PeopleListing from './index';
|
|
6
|
-
import { ThemeType } from '../../../types/types';
|
|
7
|
-
import { IPeopleListing } from '../../../types/types';
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
title: 'Components/Event Core/People Listing',
|
|
11
|
-
component: PeopleListing,
|
|
12
|
-
parameters: {
|
|
13
|
-
docs: {
|
|
14
|
-
description: {
|
|
15
|
-
component: 'PeopleListing.',
|
|
16
|
-
withSource: 'none',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
design: {
|
|
20
|
-
type: 'figma',
|
|
21
|
-
url:
|
|
22
|
-
'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/ROH%3A-Design-System-%26-Documentation?node-id=1280%3A10997',
|
|
23
|
-
},
|
|
24
|
-
jest: ['PeopleListing'],
|
|
25
|
-
},
|
|
26
|
-
decorators: [
|
|
27
|
-
(Story) => (
|
|
28
|
-
<ThemeProvider theme={ThemeType.Core}>
|
|
29
|
-
<GlobalStyles />
|
|
30
|
-
{Story()}
|
|
31
|
-
</ThemeProvider>
|
|
32
|
-
),
|
|
33
|
-
],
|
|
34
|
-
} as Meta;
|
|
35
|
-
|
|
36
|
-
const Template: Story<IPeopleListing> = (args) => <PeopleListing {...args} />;
|
|
37
|
-
|
|
38
|
-
export const PeopleListingDefault = Template.bind({});
|
|
39
|
-
|
|
40
|
-
PeopleListingDefault.args = {
|
|
41
|
-
people: [
|
|
42
|
-
{
|
|
43
|
-
role: 'Role',
|
|
44
|
-
name: "Individual's name",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
role: 'Role',
|
|
48
|
-
name: "Individual's name",
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
role: 'Role',
|
|
52
|
-
name: "Individual's name",
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
role: 'Role',
|
|
56
|
-
name: "Individual's name",
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
role: 'Role',
|
|
60
|
-
name: "Individual's name",
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
role: 'Role',
|
|
64
|
-
name: "Individual's name that spans over two lines",
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
role: 'Role',
|
|
68
|
-
name: "Individual's name",
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
role: 'Role',
|
|
72
|
-
name: "Individual's name",
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
role: 'Role that spans over two lines',
|
|
76
|
-
name: "Individual's name",
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
role: 'Role',
|
|
80
|
-
name: "Individual's name",
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
role: 'Role',
|
|
84
|
-
name: "Individual's name",
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
role: 'Role',
|
|
88
|
-
name: "Individual's name",
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
role: 'Role',
|
|
92
|
-
name: "Individual's name",
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
role: 'Role',
|
|
96
|
-
name: "Individual's name",
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
role: 'Role',
|
|
100
|
-
name: "Individual's name",
|
|
101
|
-
},
|
|
102
|
-
],
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export const PeopleListingWithLinks = Template.bind({});
|
|
106
|
-
|
|
107
|
-
PeopleListingWithLinks.args = {
|
|
108
|
-
people: [
|
|
109
|
-
{
|
|
110
|
-
role: 'Role',
|
|
111
|
-
name: "Individual's name",
|
|
112
|
-
link: 'https://google.com',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
role: 'Role',
|
|
116
|
-
name: "Individual's name",
|
|
117
|
-
link: 'https://google.com',
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
role: 'Role',
|
|
121
|
-
name: "Individual's name",
|
|
122
|
-
link: 'https://google.com',
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
role: 'Role',
|
|
126
|
-
name: "Individual's name",
|
|
127
|
-
link: 'https://google.com',
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
role: 'Role',
|
|
131
|
-
name: "Individual's name",
|
|
132
|
-
link: 'https://google.com',
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
role: 'Role',
|
|
136
|
-
name: "Individual's name that spans over two lines",
|
|
137
|
-
link: 'https://google.com',
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
role: 'Role',
|
|
141
|
-
name: "Individual's name",
|
|
142
|
-
link: 'https://google.com',
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
role: 'Role',
|
|
146
|
-
name: "Individual's name",
|
|
147
|
-
link: 'https://google.com',
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
role: 'Role that spans over two lines',
|
|
151
|
-
name: "Individual's name",
|
|
152
|
-
link: 'https://google.com',
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
role: 'Role',
|
|
156
|
-
name: "Individual's name",
|
|
157
|
-
link: 'https://google.com',
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
role: 'Role',
|
|
161
|
-
name: "Individual's name",
|
|
162
|
-
link: 'https://google.com',
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
role: 'Role',
|
|
166
|
-
name: "Individual's name",
|
|
167
|
-
link: 'https://google.com',
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
role: 'Role',
|
|
171
|
-
name: "Individual's name",
|
|
172
|
-
link: 'https://google.com',
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
role: 'Role',
|
|
176
|
-
name: "Individual's name",
|
|
177
|
-
link: 'https://google.com',
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
role: 'Role',
|
|
181
|
-
name: "Individual's name",
|
|
182
|
-
link: 'https://google.com',
|
|
183
|
-
},
|
|
184
|
-
],
|
|
185
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import PeopleListing from './PeopleListing';
|
|
4
|
-
|
|
5
|
-
describe('PeopleListing component', () => {
|
|
6
|
-
it('renders text with the proper data and a link', () => {
|
|
7
|
-
const people = [
|
|
8
|
-
{
|
|
9
|
-
role: 'director',
|
|
10
|
-
name: 'jason',
|
|
11
|
-
link: 'https://google.com',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
role: 'actor',
|
|
15
|
-
name: 'mary',
|
|
16
|
-
link: 'https://google.com',
|
|
17
|
-
},
|
|
18
|
-
];
|
|
19
|
-
|
|
20
|
-
const renderListing = render(<PeopleListing people={people} />);
|
|
21
|
-
const numberOFItems = renderListing.getAllByTitle('role').length;
|
|
22
|
-
expect(numberOFItems).toBe(2);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IPeopleListing } from '../../../types/types';
|
|
3
|
-
import IndividualListing from '../../atoms/IndividualListing';
|
|
4
|
-
import { GridItem } from '../../atoms/Grid';
|
|
5
|
-
import PeopleListingGrid from './PeopleListing.style';
|
|
6
|
-
|
|
7
|
-
const PeopleListing = ({ people }: IPeopleListing) => {
|
|
8
|
-
return (
|
|
9
|
-
<PeopleListingGrid>
|
|
10
|
-
{people.map((person, index) => {
|
|
11
|
-
return (
|
|
12
|
-
<GridItem
|
|
13
|
-
key={`${person.name}-${index}`}
|
|
14
|
-
columnStartDesktop={(index % 4) * 3 + 3}
|
|
15
|
-
columnSpanDesktop={3}
|
|
16
|
-
columnStartDevice={(index % 2) * 6 + 2}
|
|
17
|
-
columnSpanDevice={6}
|
|
18
|
-
>
|
|
19
|
-
<IndividualListing role={person.role} name={person.name} link={person.link} dataROH={person.dataROH} />
|
|
20
|
-
</GridItem>
|
|
21
|
-
);
|
|
22
|
-
})}
|
|
23
|
-
</PeopleListingGrid>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export default PeopleListing;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { devices } from '../../../styles/viewports';
|
|
3
|
-
|
|
4
|
-
export const PolicyLinksList = styled.ul`
|
|
5
|
-
margin: 0 auto;
|
|
6
|
-
padding: 0;
|
|
7
|
-
list-style: none;
|
|
8
|
-
display: flex;
|
|
9
|
-
gap: var(--footer-items-gap);
|
|
10
|
-
|
|
11
|
-
@media ${devices.mobile} {
|
|
12
|
-
& {
|
|
13
|
-
margin: 0;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
export const PolicyLinkItem = styled.li`
|
|
20
|
-
font-family: var(--font-family-overline);
|
|
21
|
-
font-size: var(--font-size-overline-1);
|
|
22
|
-
font-weight: var(--font-weigth-overline-1);
|
|
23
|
-
line-height: var(--line-height-overline-1);
|
|
24
|
-
letter-spacing: var(--letter-spacing-overline-1);
|
|
25
|
-
text-transform: var(--text-transform-overline-1);
|
|
26
|
-
text-align: center;
|
|
27
|
-
|
|
28
|
-
@media ${devices.mobile} {
|
|
29
|
-
& {
|
|
30
|
-
text-align: left;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
export const PolicyLink = styled.a`
|
|
36
|
-
width: fit-content;
|
|
37
|
-
text-decoration: none;
|
|
38
|
-
text-transform: uppercase;
|
|
39
|
-
color: var(--base-color-white);
|
|
40
|
-
cursor: pointer;
|
|
41
|
-
`;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import PolicyLinks from './PolicyLinks';
|
|
4
|
-
|
|
5
|
-
describe('PolicyLinks component', () => {
|
|
6
|
-
const links = [
|
|
7
|
-
{
|
|
8
|
-
dataRoh: 'test-data',
|
|
9
|
-
title: 'Test',
|
|
10
|
-
href: '/test',
|
|
11
|
-
name: 'test-name',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
dataRoh: 'test-data2',
|
|
15
|
-
title: 'Test2',
|
|
16
|
-
href: '/test2',
|
|
17
|
-
name: 'test-name2',
|
|
18
|
-
},
|
|
19
|
-
];
|
|
20
|
-
it('renders a list of links', () => {
|
|
21
|
-
const { getByText, getByTitle } = render(<PolicyLinks items={links} />);
|
|
22
|
-
|
|
23
|
-
expect(getByText(links[0].title)).toBeInTheDocument();
|
|
24
|
-
expect(getByTitle(links[0].title)).toBeInTheDocument();
|
|
25
|
-
expect(getByText(links[1].title)).toBeInTheDocument();
|
|
26
|
-
expect(getByTitle(links[1].title)).toBeInTheDocument();
|
|
27
|
-
});
|
|
28
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React, { FunctionComponent } from 'react';
|
|
2
|
-
import { PolicyLinksList, PolicyLinkItem, PolicyLink } from './PolicyLinks.style';
|
|
3
|
-
import { IPolicyLinksProps } from '../../../types/footer';
|
|
4
|
-
|
|
5
|
-
const PolicyLinks: FunctionComponent<IPolicyLinksProps> = ({ items = [] }) => {
|
|
6
|
-
return (
|
|
7
|
-
<PolicyLinksList>
|
|
8
|
-
{items.map((item) => (
|
|
9
|
-
<PolicyLinkItem key={item.name}>
|
|
10
|
-
<PolicyLink data-roh={item.dataRoh} href={item.href} title={item.title}>
|
|
11
|
-
{item.title}
|
|
12
|
-
</PolicyLink>
|
|
13
|
-
</PolicyLinkItem>
|
|
14
|
-
))}
|
|
15
|
-
</PolicyLinksList>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default PolicyLinks;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import PromoWithTitleComponent from './PromoWithTitle';
|
|
4
|
-
import GlobalStyles from '../../../styles/GlobalStyles';
|
|
5
|
-
import ThemeProvider from '../../../styles/ThemeProvider';
|
|
6
|
-
import { ThemeType } from '../../../types/types';
|
|
7
|
-
import EditorialImage from '../../../../external/images/editorial.jpeg';
|
|
8
|
-
import { PromoLinks } from '../../../types/editorial';
|
|
9
|
-
|
|
10
|
-
const meta: Meta = {
|
|
11
|
-
title: 'Components/Editorial/PromoWithTitle',
|
|
12
|
-
component: PromoWithTitleComponent,
|
|
13
|
-
argTypes: {
|
|
14
|
-
text: {
|
|
15
|
-
description: 'Body text inside the component',
|
|
16
|
-
},
|
|
17
|
-
title: {
|
|
18
|
-
description: 'Mandatory. Title inside the component',
|
|
19
|
-
},
|
|
20
|
-
titleSize: {
|
|
21
|
-
description: 'Size of the title. It could be "small" or "large"',
|
|
22
|
-
},
|
|
23
|
-
subtitle: {
|
|
24
|
-
description: 'Subtitle inside the component',
|
|
25
|
-
},
|
|
26
|
-
imagePosition: {
|
|
27
|
-
description: 'Position of the image inside the component',
|
|
28
|
-
},
|
|
29
|
-
ref: {
|
|
30
|
-
table: { disable: true },
|
|
31
|
-
},
|
|
32
|
-
theme: {
|
|
33
|
-
table: { disable: true },
|
|
34
|
-
},
|
|
35
|
-
as: {
|
|
36
|
-
table: { disable: true },
|
|
37
|
-
},
|
|
38
|
-
forwardedAs: {
|
|
39
|
-
table: { disable: true },
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
decorators: [
|
|
43
|
-
(Story) => (
|
|
44
|
-
<ThemeProvider theme={ThemeType.Core}>
|
|
45
|
-
<GlobalStyles />
|
|
46
|
-
{Story()}
|
|
47
|
-
</ThemeProvider>
|
|
48
|
-
),
|
|
49
|
-
],
|
|
50
|
-
parameters: {
|
|
51
|
-
docs: {
|
|
52
|
-
description: {
|
|
53
|
-
component:
|
|
54
|
-
'This component is used to house any textural information which have imagery or links to other pages',
|
|
55
|
-
withSource: 'none',
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
design: {
|
|
59
|
-
type: 'figma',
|
|
60
|
-
url:
|
|
61
|
-
'https://www.figma.com/file/PtlqtJAjr87djTyD0x40m9/ROH%3A-Design-System-%26-Documentation?node-id=1179%3A5195',
|
|
62
|
-
},
|
|
63
|
-
jest: ['Editorial'],
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export default meta;
|
|
68
|
-
|
|
69
|
-
interface IStorybookEditorialProps {
|
|
70
|
-
text?: string;
|
|
71
|
-
title: string;
|
|
72
|
-
titleSize?: 'large' | 'small';
|
|
73
|
-
subtitle?: string;
|
|
74
|
-
imagePosition?: 'left' | 'right';
|
|
75
|
-
links?: PromoLinks;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const PromoWithTitleTemplate: Story<IStorybookEditorialProps> = (args) => (
|
|
79
|
-
<PromoWithTitleComponent {...args}>
|
|
80
|
-
<img src={EditorialImage} alt="test" />
|
|
81
|
-
</PromoWithTitleComponent>
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
export const PromoWithTitle = PromoWithTitleTemplate.bind({});
|
|
85
|
-
PromoWithTitle.args = {
|
|
86
|
-
title: 'title',
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export const PromoWithTitleSubtitleAndText = PromoWithTitleTemplate.bind({});
|
|
90
|
-
PromoWithTitleSubtitleAndText.args = {
|
|
91
|
-
text:
|
|
92
|
-
'Descriptive copy. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cursus imperdiet massa aliquam adipiscing sit semper netus sit gravida. Leo ullamcorper nec vel feugiat consectetur vel. Iaculis donec euismod vulputate libero adipiscing. Nunc nulla sed purus netus dignissim enim habitant at.',
|
|
93
|
-
subtitle: 'Optional subtitle. Lorem ipsum dolor sit amet, consectetur adipiscing elite.',
|
|
94
|
-
title: 'title',
|
|
95
|
-
titleSize: 'small',
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
export const PromoWithTitleSubtitleTextAndOneLink = PromoWithTitleTemplate.bind({});
|
|
99
|
-
PromoWithTitleSubtitleTextAndOneLink.args = {
|
|
100
|
-
text:
|
|
101
|
-
'Descriptive copy. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cursus imperdiet massa aliquam adipiscing sit semper netus sit gravida. Leo ullamcorper nec vel feugiat consectetur vel. Iaculis donec euismod vulputate libero adipiscing. Nunc nulla sed purus netus dignissim enim habitant at.',
|
|
102
|
-
subtitle: 'Optional subtitle. Lorem ipsum dolor sit amet, consectetur adipiscing elite.',
|
|
103
|
-
title: 'title',
|
|
104
|
-
titleSize: 'small',
|
|
105
|
-
links: [{ text: 'Button text', href: '/test', target: '_blank' }],
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
export const PromoWithTitleSubtitleTextAndLinks = PromoWithTitleTemplate.bind({});
|
|
109
|
-
PromoWithTitleSubtitleTextAndLinks.args = {
|
|
110
|
-
text:
|
|
111
|
-
'Descriptive copy. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cursus imperdiet massa aliquam adipiscing sit semper netus sit gravida. Leo ullamcorper nec vel feugiat consectetur vel. Iaculis donec euismod vulputate libero adipiscing. Nunc nulla sed purus netus dignissim enim habitant at.',
|
|
112
|
-
subtitle: 'Optional subtitle. Lorem ipsum dolor sit amet, consectetur adipiscing elite.',
|
|
113
|
-
title: 'title',
|
|
114
|
-
titleSize: 'small',
|
|
115
|
-
links: [
|
|
116
|
-
{ text: 'Button text', href: '/test', target: '_blank', iconName: 'Tickets' },
|
|
117
|
-
{ text: 'Button text', href: '/test', target: '_blank' },
|
|
118
|
-
],
|
|
119
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { Grid } from '../../atoms';
|
|
3
|
-
import { IEditorialGridProps } from '../../../types/editorial';
|
|
4
|
-
import { devices } from '../../../styles/viewports';
|
|
5
|
-
|
|
6
|
-
export const PromoWithTitleGrid = styled(Grid)<IEditorialGridProps>`
|
|
7
|
-
grid-template-areas: ${({ imageToLeft }) =>
|
|
8
|
-
imageToLeft
|
|
9
|
-
? `'left left left left left left left left . right right right right right . .'`
|
|
10
|
-
: `'. . left left left left left . right right right right right right right right'`};
|
|
11
|
-
|
|
12
|
-
@media ${devices.tablet} {
|
|
13
|
-
& {
|
|
14
|
-
grid-template-areas: ${({ imageToLeft }) =>
|
|
15
|
-
imageToLeft
|
|
16
|
-
? `'left left left left left left left . right right right right right .'`
|
|
17
|
-
: `'. left left left left left . right right right right right right right'`};
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@media ${devices.mobile} {
|
|
22
|
-
& {
|
|
23
|
-
grid-template-columns: var(--grid-margin) minmax(0, 1fr) var(--grid-margin);
|
|
24
|
-
grid-template-rows: min-content 24px min-content;
|
|
25
|
-
gap: 0;
|
|
26
|
-
grid-template-areas:
|
|
27
|
-
'row1 row1 row1'
|
|
28
|
-
'. . .'
|
|
29
|
-
'. row2 .';
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
33
|
-
|
|
34
|
-
export const PromoWithTitleImageWrapper = styled.div<IEditorialGridProps>`
|
|
35
|
-
grid-area: ${({ imageToLeft }) => (imageToLeft ? 'left' : 'right')};
|
|
36
|
-
@media ${devices.mobile} {
|
|
37
|
-
& {
|
|
38
|
-
grid-area: row1;
|
|
39
|
-
}
|
|
40
|
-
`;
|
|
41
|
-
|
|
42
|
-
export const PromoWithTitleContentWrapper = styled.div<IEditorialGridProps>`
|
|
43
|
-
grid-area: ${({ imageToLeft }) => (imageToLeft ? 'right' : 'left')};
|
|
44
|
-
align-self: center;
|
|
45
|
-
@media ${devices.mobile} {
|
|
46
|
-
& {
|
|
47
|
-
grid-area: row2;
|
|
48
|
-
align-self: start;
|
|
49
|
-
}
|
|
50
|
-
`;
|
|
51
|
-
|
|
52
|
-
export const PromoWithTitleContainer = styled.div`
|
|
53
|
-
margin: 0 0 32px 0;
|
|
54
|
-
|
|
55
|
-
h2,
|
|
56
|
-
h3 {
|
|
57
|
-
margin: 0;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@media ${devices.mobile} {
|
|
61
|
-
& {
|
|
62
|
-
margin: 0 0 24px 0;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
`;
|
|
66
|
-
|
|
67
|
-
export const PromoWithTitleSubtitle = styled.span`
|
|
68
|
-
font-family: var(--font-family-subtitles);
|
|
69
|
-
font-size: var(--font-size-subtitles-1);
|
|
70
|
-
font-weight: var(--font-weigth-subtitles-1);
|
|
71
|
-
line-height: var(--line-height-subtitles-1);
|
|
72
|
-
letter-spacing: var(--letter-spacing-subtitles-1);
|
|
73
|
-
text-transform: var(--text-transform-subtitles-1);
|
|
74
|
-
margin-bottom: var(--editorial-subtitle-margin-bottom);
|
|
75
|
-
display: block;
|
|
76
|
-
overflow-wrap: break-word;
|
|
77
|
-
`;
|
|
78
|
-
|
|
79
|
-
export const PromoWithTitleText = styled.div`
|
|
80
|
-
font-family: var(--font-family-body);
|
|
81
|
-
font-size: var(--font-size-body-1);
|
|
82
|
-
font-weight: var(--font-weigth-body-1);
|
|
83
|
-
line-height: var(--line-height-body-1);
|
|
84
|
-
letter-spacing: var(--letter-spacing-body-1);
|
|
85
|
-
text-transform: var(--text-transform-body-1);
|
|
86
|
-
margin: 0;
|
|
87
|
-
padding: 0;
|
|
88
|
-
white-space: break-spaces;
|
|
89
|
-
overflow-wrap: break-word;
|
|
90
|
-
|
|
91
|
-
em {
|
|
92
|
-
font-family: var(--font-family-body-italics);
|
|
93
|
-
font-style: normal;
|
|
94
|
-
}
|
|
95
|
-
`;
|
|
96
|
-
|
|
97
|
-
export const ButtonsContainer = styled.div`
|
|
98
|
-
display: flex;
|
|
99
|
-
gap: 16px;
|
|
100
|
-
margin-top: 32px;
|
|
101
|
-
|
|
102
|
-
@media ${devices.mobile} {
|
|
103
|
-
gap: 24px;
|
|
104
|
-
margin-top: 24px;
|
|
105
|
-
flex-direction: column;
|
|
106
|
-
align-items: center;
|
|
107
|
-
}
|
|
108
|
-
`;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, within } from '@testing-library/react';
|
|
3
|
-
import PromoWithTitle from './PromoWithTitle';
|
|
4
|
-
import { PromoLinks } from '../../../types/editorial';
|
|
5
|
-
|
|
6
|
-
describe('PromoWithTitle component', () => {
|
|
7
|
-
const Image = () => <img data-testid="test-image" src="/foo" alt="test" />;
|
|
8
|
-
const text = 'foo text';
|
|
9
|
-
const subtitle = 'foo subtitle';
|
|
10
|
-
const title = 'test';
|
|
11
|
-
|
|
12
|
-
it('renders image to the left if no position is set', () => {
|
|
13
|
-
const { getByTestId } = render(
|
|
14
|
-
<PromoWithTitle title={title}>
|
|
15
|
-
<Image />
|
|
16
|
-
</PromoWithTitle>
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
const imageGridItem = getByTestId('image-wrapper');
|
|
20
|
-
const contentGridItem = getByTestId('content-wrapper');
|
|
21
|
-
|
|
22
|
-
expect(imageGridItem).toHaveStyle({ 'grid-area': 'left' });
|
|
23
|
-
expect(contentGridItem).toHaveStyle({ 'grid-area': 'right' });
|
|
24
|
-
expect(within(imageGridItem).getByTestId('test-image')).toBeInTheDocument();
|
|
25
|
-
expect(within(contentGridItem).getByText(title)).toBeInTheDocument();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('renders only image and title if any prop is not provided', () => {
|
|
29
|
-
const { getByTestId } = render(
|
|
30
|
-
<PromoWithTitle title={title}>
|
|
31
|
-
<Image />
|
|
32
|
-
</PromoWithTitle>
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
const imageGridItem = getByTestId('image-wrapper');
|
|
36
|
-
const contentGridItem = getByTestId('content-wrapper');
|
|
37
|
-
expect(within(imageGridItem).getByTestId('test-image')).toBeInTheDocument();
|
|
38
|
-
expect(within(contentGridItem).getByText(title)).toBeInTheDocument();
|
|
39
|
-
expect(within(contentGridItem).queryAllByText(subtitle)).toHaveLength(0);
|
|
40
|
-
expect(within(contentGridItem).queryAllByTestId('buttons-wrapper')).toHaveLength(0);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('renders image and title properly when image position is right', () => {
|
|
44
|
-
const { getByTestId } = render(
|
|
45
|
-
<PromoWithTitle imagePosition="right" title={title}>
|
|
46
|
-
<Image />
|
|
47
|
-
</PromoWithTitle>
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
const imageGridItem = getByTestId('image-wrapper');
|
|
51
|
-
const contentGridItem = getByTestId('content-wrapper');
|
|
52
|
-
|
|
53
|
-
expect(imageGridItem).toHaveStyle({ 'grid-area': 'right' });
|
|
54
|
-
expect(contentGridItem).toHaveStyle({ 'grid-area': 'left' });
|
|
55
|
-
expect(within(imageGridItem).getByTestId('test-image')).toBeInTheDocument();
|
|
56
|
-
expect(within(contentGridItem).getByText(title)).toBeInTheDocument();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('renders optional props (subtitle, text and links)', () => {
|
|
60
|
-
const links: PromoLinks = [{ text: 'link' }, { text: 'link2' }];
|
|
61
|
-
const { getByTestId } = render(
|
|
62
|
-
<PromoWithTitle title={title} subtitle={subtitle} text={text} links={links}>
|
|
63
|
-
<Image />
|
|
64
|
-
</PromoWithTitle>
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
const contentGridItem = getByTestId('content-wrapper');
|
|
68
|
-
|
|
69
|
-
expect(within(contentGridItem).getByText(title)).toBeInTheDocument();
|
|
70
|
-
expect(within(contentGridItem).getByText(subtitle)).toBeInTheDocument();
|
|
71
|
-
expect(within(contentGridItem).getByText(text)).toBeInTheDocument();
|
|
72
|
-
expect(within(contentGridItem).getByText(links[0].text)).toBeInTheDocument();
|
|
73
|
-
expect(within(contentGridItem).getByText(links[1]?.text as string)).toBeInTheDocument();
|
|
74
|
-
});
|
|
75
|
-
});
|