@royaloperahouse/chord 1.1.0 → 1.3.0-a-chord-development
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/CHANGELOG.md +6 -0
- package/README.md +99 -44
- package/dist/chord.cjs.development.js +138 -69
- 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 +139 -70
- package/dist/chord.esm.js.map +1 -1
- package/dist/components/atoms/Sponsorship/Sponsorship.style.d.ts +1 -0
- package/dist/components/atoms/Typography/Typography.d.ts +1 -1
- package/dist/components/molecules/PageHeading/Impact/Impact.d.ts +1 -1
- package/dist/components/molecules/PromoWithTags/PromoWithTags.style.d.ts +5 -3
- package/dist/helpers/defaultValues.d.ts +7 -0
- package/dist/types/card.d.ts +4 -0
- package/dist/types/editorial.d.ts +16 -30
- package/dist/types/impactHeader.d.ts +50 -0
- package/dist/types/types.d.ts +4 -0
- package/dist/types/typography.d.ts +5 -1
- package/package.json +1 -1
- package/README.GIT +0 -122
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,67 +1,122 @@
|
|
|
1
|
-
# Royal Opera House -
|
|
1
|
+
# Royal Opera House - Front End Design System
|
|
2
2
|
|
|
3
|
-
Welcome to the Royal Opera House
|
|
3
|
+
Welcome to the Royal Opera House Front End Design System, `@royaloperahouse/chord`.
|
|
4
4
|
|
|
5
5
|
This package is a library of UI components intended to be used in the ROH website.
|
|
6
6
|
|
|
7
|
+
It uses React, TypeScript, TSDX and Storybook.
|
|
7
8
|
|
|
8
|
-
##
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
The required package dependencies need to be insalled using `yarn`. Once ready you can issue the following:
|
|
12
|
+
|
|
13
|
+
To run Lint on the package use:
|
|
9
14
|
|
|
10
15
|
```bash
|
|
11
|
-
|
|
16
|
+
yarn lint # you can also use the --fix option to perform automatic fixes
|
|
12
17
|
```
|
|
18
|
+
|
|
19
|
+
To run the unit tests (using Jest) use:
|
|
20
|
+
|
|
13
21
|
```bash
|
|
14
|
-
|
|
22
|
+
yarn test # you can also use the -u option to update snapshots if needed
|
|
15
23
|
```
|
|
16
24
|
|
|
17
|
-
|
|
25
|
+
To run the unit tests (using Jest) and store them for display in storybook use:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
yarn test-storybook # you can also use the -u option to update snapshots if needed
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
To run storybook use:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
yarn storybook
|
|
35
|
+
```
|
|
18
36
|
|
|
19
|
-
|
|
20
|
-
import {
|
|
21
|
-
Footer, GlobalStyles, ThemeProvider, ThemeType,
|
|
22
|
-
} from '@royaloperahouse/chord';
|
|
37
|
+
To build a static version of storybook use:
|
|
23
38
|
|
|
39
|
+
```bash
|
|
40
|
+
yarn build-storybook
|
|
24
41
|
```
|
|
25
|
-
## Sample
|
|
26
|
-
|
|
27
|
-
```javascript
|
|
28
|
-
|
|
29
|
-
import {
|
|
30
|
-
Footer, GlobalStyles, ThemeProvider, ThemeType,
|
|
31
|
-
} from '@royaloperahouse/chord';
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const App = ({ children }: InnerProps): React.ReactElement => (
|
|
35
|
-
<ErrorBoundary>
|
|
36
|
-
<ThemeProvider theme={ThemeType.Core}>
|
|
37
|
-
<GlobalStyles />
|
|
38
|
-
<Wrapper>
|
|
39
|
-
<Header />
|
|
40
|
-
<GlobalStyle />
|
|
41
|
-
<HealthBanner />
|
|
42
|
-
<ErrorBoundary>
|
|
43
|
-
<Content>
|
|
44
|
-
{children}
|
|
45
|
-
</Content>
|
|
46
|
-
</ErrorBoundary>
|
|
47
|
-
<LiveChat />
|
|
48
|
-
</Wrapper>
|
|
49
|
-
<Footer data={footerData} />
|
|
50
|
-
</ThemeProvider>
|
|
51
|
-
</ErrorBoundary>
|
|
52
|
-
);
|
|
53
42
|
|
|
43
|
+
This will create a static copy in `./storybook-static`, and there is an index.html page inside the core directory. This allows the site to be previewed directly in the git repository via serving pages (it needs to be configured for that branch).
|
|
44
|
+
|
|
45
|
+
To deploy the storybook publically:
|
|
46
|
+
|
|
47
|
+
### Prerequisites
|
|
48
|
+
|
|
49
|
+
Make sure you have credentials for the *parent* 'Royal Opera House' AWS account in your `~/.aws/credentials` file. The deploy script expects these to be called `[parent]`.
|
|
50
|
+
|
|
51
|
+
You can get these values at:
|
|
52
|
+
|
|
53
|
+
AWS 'Your Applications' page -> 'Royal Opera House' -> 'Developer Access' ->
|
|
54
|
+
'Command line or programmatic access'
|
|
55
|
+
|
|
56
|
+
### Deployment
|
|
57
|
+
|
|
58
|
+
To deploy, first *build* the storybook as above
|
|
59
|
+
|
|
60
|
+
then use:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
yarn deploy-storybook
|
|
54
64
|
```
|
|
55
65
|
|
|
56
|
-
|
|
66
|
+
This will deploy the contents of `./storybook-static` to S3 as a static site accessible at [chord.roh.org.uk](chord.roh.org.uk)
|
|
67
|
+
|
|
68
|
+
To build the package use:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
yarn build
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
To release a new version.
|
|
75
|
+
|
|
76
|
+
Release will be published in npm (NPM_TOKEN will be required)
|
|
77
|
+
Storybook will be pushed to bitbucket. *** Push will be done Ensure you don't have things pendint to push
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-release
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
MORE INFO TO FOLLOW - PARTICULARLY FOR THE CI SETUP AND HOW PACKAGES ARE PUSHED.
|
|
85
|
+
|
|
86
|
+
# Recommended Use of Package
|
|
87
|
+
|
|
88
|
+
The package is deployed to NPM, and can be installed using yarn or npm:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npm i --save @royaloperahouse/chord
|
|
92
|
+
```
|
|
93
|
+
```bash
|
|
94
|
+
yarn add @royaloperahouse/chord
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
# Processes to follow prior to commits
|
|
98
|
+
|
|
99
|
+
Before a commit is made you need to do the following:
|
|
100
|
+
|
|
101
|
+
- Make sure that you are in your own work branch (properly named, including the JIRA ticket number and a short description)
|
|
102
|
+
- `yarn lint` - ensure that you are not introducing errors
|
|
103
|
+
- `yarn test` - ensure that tests are running as expected
|
|
104
|
+
- `yarn test-storybook` - Save the test results to for the static site
|
|
105
|
+
- `yarn build-storybook` - Update the static site
|
|
106
|
+
- Commit your changes in your branch locally
|
|
57
107
|
|
|
58
|
-
|
|
108
|
+
Next, if you are ready to merge into the main development branch then:
|
|
59
109
|
|
|
60
|
-
|
|
110
|
+
- _*ensure that you pull the latest changes from that branch into your new branch, resolving any merge conflicts that may arise*_
|
|
111
|
+
- Commit any merge changes locally
|
|
112
|
+
- Push your branch changes to the origin repo
|
|
113
|
+
- Raise a Pull Request to merge back into the main development branch, AND ensure that the required reviewers are assigned.
|
|
114
|
+
- The reviewers may raise issues, and once resolved, they will be responsible for performing the merge.
|
|
61
115
|
|
|
62
|
-
|
|
116
|
+
### Example
|
|
63
117
|
|
|
118
|
+
There is an example implementation in the example folder. Alternatively there are also integration examples in storybook. Make sure to keep these updated so as to showcase the current components available.
|
|
64
119
|
|
|
65
|
-
|
|
120
|
+
### Bundle analysis
|
|
66
121
|
|
|
67
|
-
|
|
122
|
+
Calculates the real cost of your library using [size-limit](https://github.com/ai/size-limit) with `yarn size` and visulize it with `yarn analyze`.
|
|
@@ -2655,10 +2655,11 @@ var SponsorLogo = function SponsorLogo(_ref) {
|
|
|
2655
2655
|
};
|
|
2656
2656
|
|
|
2657
2657
|
var _templateObject$d;
|
|
2658
|
+
var SponsorshipStyledIframe = /*#__PURE__*/styled__default.div(_templateObject$d || (_templateObject$d = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background-color: transparent;\n height: 80px;\n margin: 0px;\n overflow: hidden;\n padding: 0;\n width: 80px;\n\n & > iframe {\n border: 0;\n display: block;\n margin: 0px;\n padding: 0px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n }\n\n @media ", " {\n & {\n height: 40px;\n width: 40px;\n }\n & iframe {\n height: 80px;\n transform: scale(0.5) translate(-40px, -40px);\n width: 80px;\n }\n }\n"])), devices.mobile);
|
|
2659
|
+
|
|
2658
2660
|
var DEFAULT_SPONSORSHIP_IFRAME = 'https://static.roh.org.uk/rolex/v3/rolex.html?size=80';
|
|
2659
2661
|
var DEFAULT_SPONSORSHIP_TITLE = 'rolex';
|
|
2660
2662
|
var DEFAULT_DATA_ROH = 'ImgAdvert';
|
|
2661
|
-
var SponsorshipStyled = /*#__PURE__*/styled__default.div(_templateObject$d || (_templateObject$d = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background-color: transparent;\n height: 80px;\n margin: 0px;\n overflow: hidden;\n padding: 0;\n width: 80px;\n\n & > iframe {\n border: 0;\n display: block;\n margin: 0px;\n padding: 0px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n }\n\n @media ", " {\n & {\n height: 40px;\n width: 40px;\n }\n & iframe {\n height: 80px;\n transform: scale(0.5) translate(-40px, -40px);\n width: 80px;\n }\n }\n"])), devices.mobile);
|
|
2662
2663
|
|
|
2663
2664
|
var Sponsorship = function Sponsorship(_ref) {
|
|
2664
2665
|
var _ref$src = _ref.src,
|
|
@@ -2666,8 +2667,15 @@ var Sponsorship = function Sponsorship(_ref) {
|
|
|
2666
2667
|
_ref$dataRoh = _ref.dataRoh,
|
|
2667
2668
|
dataRoh = _ref$dataRoh === void 0 ? DEFAULT_DATA_ROH : _ref$dataRoh,
|
|
2668
2669
|
_ref$title = _ref.title,
|
|
2669
|
-
title = _ref$title === void 0 ? DEFAULT_SPONSORSHIP_TITLE : _ref$title
|
|
2670
|
-
|
|
2670
|
+
title = _ref$title === void 0 ? DEFAULT_SPONSORSHIP_TITLE : _ref$title,
|
|
2671
|
+
isCustomImage = _ref.isCustomImage;
|
|
2672
|
+
if (isCustomImage) return /*#__PURE__*/React__default.createElement("img", {
|
|
2673
|
+
src: src,
|
|
2674
|
+
alt: title,
|
|
2675
|
+
"data-roh": dataRoh,
|
|
2676
|
+
"data-testid": "custom-sponsor"
|
|
2677
|
+
});
|
|
2678
|
+
return /*#__PURE__*/React__default.createElement(SponsorshipStyledIframe, null, /*#__PURE__*/React__default.createElement("iframe", {
|
|
2671
2679
|
src: src,
|
|
2672
2680
|
scrolling: "no",
|
|
2673
2681
|
"data-roh": dataRoh,
|
|
@@ -2974,9 +2982,10 @@ var BodyText = function BodyText(_ref3) {
|
|
|
2974
2982
|
}, children);
|
|
2975
2983
|
};
|
|
2976
2984
|
var Header = function Header(_ref4) {
|
|
2977
|
-
var
|
|
2985
|
+
var semanticLevel = _ref4.semanticLevel,
|
|
2986
|
+
level = _ref4.level,
|
|
2978
2987
|
children = _ref4.children;
|
|
2979
|
-
var renderedTag = "h" + level;
|
|
2988
|
+
var renderedTag = semanticLevel ? "h" + semanticLevel : "h" + level;
|
|
2980
2989
|
return /*#__PURE__*/React__default.createElement(StyledTag, {
|
|
2981
2990
|
tag: renderedTag,
|
|
2982
2991
|
typography: "header",
|
|
@@ -4985,10 +4994,15 @@ var getButtonsOpacity = function getButtonsOpacity(_ref4) {
|
|
|
4985
4994
|
return onlyShowButtonsOnHover ? 'opacity: 0;' : 'opacity: 1;';
|
|
4986
4995
|
};
|
|
4987
4996
|
|
|
4988
|
-
var
|
|
4989
|
-
var
|
|
4990
|
-
|
|
4991
|
-
|
|
4997
|
+
var getButtonsMinHeight = function getButtonsMinHeight(_ref5) {
|
|
4998
|
+
var onlyShowButtonsOnHover = _ref5.onlyShowButtonsOnHover;
|
|
4999
|
+
return onlyShowButtonsOnHover ? 'min-height: unset;' : 'min-height: 120px;';
|
|
5000
|
+
};
|
|
5001
|
+
|
|
5002
|
+
var ButtonsContainer$1 = /*#__PURE__*/styled__default.div(_templateObject9$3 || (_templateObject9$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n ", ";\n display: flex;\n gap: 16px;\n margin-top: var(--editorial-margin-between);\n\n ", "\n\n @media ", " {\n ", ";\n margin-left: ", ";\n margin-right: ", ";\n opacity: 1 !important;\n gap: 24px;\n margin-top: 24px;\n flex-direction: column;\n align-items: center;\n }\n\n @media ", " {\n ", ";\n opacity: 1 !important;\n gap: 24px;\n margin-top: 24px;\n align-items: flex-start;\n\n ", "\n }\n"])), getButtonsOpacity, function (_ref6) {
|
|
5003
|
+
var size = _ref6.size,
|
|
5004
|
+
primaryButtonTextLength = _ref6.primaryButtonTextLength,
|
|
5005
|
+
tertiaryButtonTextLength = _ref6.tertiaryButtonTextLength;
|
|
4992
5006
|
var isLinksLayoutColumn = size === 'small' ? primaryButtonTextLength >= LENGTH_SMALL_TEXT || tertiaryButtonTextLength >= LENGTH_SMALL_TEXT : primaryButtonTextLength >= LENGTH_LARGE_TEXT || tertiaryButtonTextLength >= LENGTH_LARGE_TEXT;
|
|
4993
5007
|
|
|
4994
5008
|
if (isLinksLayoutColumn) {
|
|
@@ -4996,9 +5010,15 @@ var ButtonsContainer$1 = /*#__PURE__*/styled__default.div(_templateObject9$3 ||
|
|
|
4996
5010
|
}
|
|
4997
5011
|
|
|
4998
5012
|
return '';
|
|
4999
|
-
}, devices.mobile,
|
|
5000
|
-
var
|
|
5001
|
-
|
|
5013
|
+
}, devices.mobile, getButtonsMinHeight, function (_ref7) {
|
|
5014
|
+
var fullWidth = _ref7.fullWidth;
|
|
5015
|
+
return fullWidth ? '0' : '20px';
|
|
5016
|
+
}, function (_ref8) {
|
|
5017
|
+
var fullWidth = _ref8.fullWidth;
|
|
5018
|
+
return fullWidth ? '0' : '20px';
|
|
5019
|
+
}, devices.tablet, getButtonsMinHeight, function (_ref9) {
|
|
5020
|
+
var primaryButtonTextLength = _ref9.primaryButtonTextLength,
|
|
5021
|
+
tertiaryButtonTextLength = _ref9.tertiaryButtonTextLength;
|
|
5002
5022
|
var isLinksLayoutColumnTablet = primaryButtonTextLength >= LENGTH_TEXT_TABLET || tertiaryButtonTextLength >= LENGTH_TEXT_TABLET;
|
|
5003
5023
|
|
|
5004
5024
|
if (isLinksLayoutColumnTablet) {
|
|
@@ -5147,7 +5167,8 @@ var Card = function Card(_ref) {
|
|
|
5147
5167
|
size: size,
|
|
5148
5168
|
primaryButtonTextLength: firstButtonText.length,
|
|
5149
5169
|
tertiaryButtonTextLength: secondButtonText.length,
|
|
5150
|
-
onlyShowButtonsOnHover: onlyShowButtonsOnHover
|
|
5170
|
+
onlyShowButtonsOnHover: onlyShowButtonsOnHover,
|
|
5171
|
+
fullWidth: fullWidth
|
|
5151
5172
|
}, firstButton && /*#__PURE__*/React__default.createElement(FirstButtonComponent, Object.assign({}, restFirstButton), primaryButtonTextTruncate), secondButton && /*#__PURE__*/React__default.createElement(SecondButtonComponent, Object.assign({}, restSecondButton), tertiaryButtonTextTruncate)));
|
|
5152
5173
|
};
|
|
5153
5174
|
|
|
@@ -5186,7 +5207,8 @@ var Cards = function Cards(_ref) {
|
|
|
5186
5207
|
links: card.links,
|
|
5187
5208
|
tags: card.tags,
|
|
5188
5209
|
withContinueWatching: card.withContinueWatching,
|
|
5189
|
-
onlyShowButtonsOnHover: card.onlyShowButtonsOnHover
|
|
5210
|
+
onlyShowButtonsOnHover: card.onlyShowButtonsOnHover,
|
|
5211
|
+
fullWidth: card.fullWidth
|
|
5190
5212
|
}));
|
|
5191
5213
|
}));
|
|
5192
5214
|
};
|
|
@@ -5572,6 +5594,7 @@ var PageHeadingImpact = function PageHeadingImpact(_ref) {
|
|
|
5572
5594
|
link = _ref.link,
|
|
5573
5595
|
_ref$sponsor = _ref.sponsor,
|
|
5574
5596
|
sponsor = _ref$sponsor === void 0 ? true : _ref$sponsor,
|
|
5597
|
+
customSponsorData = _ref.customSponsorData,
|
|
5575
5598
|
scrollHref = _ref.scrollHref,
|
|
5576
5599
|
bgUrlDesktop = _ref.bgUrlDesktop,
|
|
5577
5600
|
bgUrlDevice = _ref.bgUrlDevice;
|
|
@@ -5587,7 +5610,11 @@ var PageHeadingImpact = function PageHeadingImpact(_ref) {
|
|
|
5587
5610
|
"data-testid": "impact-wrapper"
|
|
5588
5611
|
}, sponsor ? /*#__PURE__*/React__default.createElement(SponsorWrapper, {
|
|
5589
5612
|
"data-testid": "impact-sponsor"
|
|
5590
|
-
},
|
|
5613
|
+
}, customSponsorData ? /*#__PURE__*/React__default.createElement(Sponsorship, Object.assign({
|
|
5614
|
+
"data-testid": "impact-custom-sponsor"
|
|
5615
|
+
}, customSponsorData, {
|
|
5616
|
+
isCustomImage: true
|
|
5617
|
+
})) : /*#__PURE__*/React__default.createElement(Sponsorship, null)) : null, /*#__PURE__*/React__default.createElement(ImpactGrid, null, children ? /*#__PURE__*/React__default.createElement(LogoWrapper$2, {
|
|
5591
5618
|
"data-testid": "impact-logo"
|
|
5592
5619
|
}, children) : null, text ? /*#__PURE__*/React__default.createElement(TextWrapper$1, {
|
|
5593
5620
|
"data-testid": "impact-text"
|
|
@@ -5684,47 +5711,41 @@ var PeopleListing = function PeopleListing(_ref) {
|
|
|
5684
5711
|
}));
|
|
5685
5712
|
};
|
|
5686
5713
|
|
|
5687
|
-
var _templateObject$P, _templateObject2$x, _templateObject3$p, _templateObject4$j, _templateObject5$e, _templateObject6$b, _templateObject7$7, _templateObject8$6, _templateObject9$4, _templateObject10$3, _templateObject11$2, _templateObject12$1, _templateObject13, _templateObject14, _templateObject15;
|
|
5714
|
+
var _templateObject$P, _templateObject2$x, _templateObject3$p, _templateObject4$j, _templateObject5$e, _templateObject6$b, _templateObject7$7, _templateObject8$6, _templateObject9$4, _templateObject10$3, _templateObject11$2, _templateObject12$1, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18;
|
|
5688
5715
|
var LENGTH_TEXT = 28;
|
|
5689
|
-
var LENGTH_TEXT_TABLET$1 =
|
|
5690
|
-
var
|
|
5716
|
+
var LENGTH_TEXT_TABLET$1 = 12;
|
|
5717
|
+
var GridTemplateImageToLeft = "'left left left left left left left left . right right right right right . .'";
|
|
5718
|
+
var GridTemplateImageToRight = "'. . left left left left left . right right right right right right right right'";
|
|
5719
|
+
var GridTemplateAsCard = "'. . left left left left left right right right right right right right . . '";
|
|
5720
|
+
var GridTemplateAsCardTablet = "'. . left left left left left left left right right right right right . . '";
|
|
5721
|
+
var PromoWithTagsGrid = /*#__PURE__*/styled__default(Grid)(_templateObject$P || (_templateObject$P = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n grid-template-areas: ", ";\n\n @media ", " {\n & {\n grid-template-areas: ", ";\n }\n }\n\n @media ", " {\n & {\n grid-template-columns: var(--grid-margin) minmax(0, 1fr) var(--grid-margin);\n grid-template-rows: min-content 24px min-content;\n gap: 0;\n grid-template-areas:\n 'row1 row1 row1'\n '. . .'\n '. row2 .';\n }\n }\n\n /* Overwrite template for card */\n ", "\n"])), function (_ref) {
|
|
5691
5722
|
var imageToLeft = _ref.imageToLeft;
|
|
5692
|
-
return imageToLeft ?
|
|
5723
|
+
return imageToLeft ? GridTemplateImageToLeft : GridTemplateImageToRight;
|
|
5693
5724
|
}, devices.tablet, function (_ref2) {
|
|
5694
5725
|
var imageToLeft = _ref2.imageToLeft;
|
|
5695
5726
|
return imageToLeft ? "'left left left left left left left right right right right right right .'" : "'. left left left left left left right right right right right right right'";
|
|
5696
|
-
}, devices.mobile)
|
|
5697
|
-
|
|
5698
|
-
var imageToLeft = _ref3.imageToLeft;
|
|
5699
|
-
return imageToLeft ? 'left' : 'right';
|
|
5700
|
-
}, devices.mobile);
|
|
5701
|
-
var PromoWithTagsContentWrapper = /*#__PURE__*/styled__default.div(_templateObject3$p || (_templateObject3$p = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n grid-area: ", ";\n align-self: center;\n @media ", " {\n & {\n display: ", ";\n grid-area: row2;\n align-self: start;\n }\n }\n"])), function (_ref4) {
|
|
5702
|
-
var imageToLeft = _ref4.imageToLeft;
|
|
5703
|
-
return imageToLeft ? 'right' : 'left';
|
|
5704
|
-
}, devices.mobile, function (_ref5) {
|
|
5705
|
-
var hideSection = _ref5.hideSection;
|
|
5706
|
-
return hideSection ? 'none' : 'block';
|
|
5727
|
+
}, devices.mobile, function (asCard) {
|
|
5728
|
+
return asCard ? "\n grid-template-areas: " + GridTemplateAsCard + ";\n @media " + devices.tablet + " {\n grid-template-areas: " + GridTemplateAsCardTablet + ";\n }\n " : "";
|
|
5707
5729
|
});
|
|
5708
|
-
var
|
|
5709
|
-
var
|
|
5710
|
-
var
|
|
5711
|
-
var theme = _ref6.theme;
|
|
5730
|
+
var PromoWithTagsSubtitle = /*#__PURE__*/styled__default.span(_templateObject2$x || (_templateObject2$x = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-family: var(--font-family-subtitle);\n font-feature-settings: var(--font-feature-settings-subtitle);\n font-size: var(--font-size-subtitle-1);\n font-weight: var(--font-weight-subtitle-1);\n line-height: var(--line-height-subtitle-1);\n letter-spacing: var(--letter-spacing-subtitle-1);\n text-transform: var(--text-transform-subtitle);\n margin-bottom: var(--editorial-subtitle-margin-bottom);\n display: block;\n overflow-wrap: break-word;\n"])));
|
|
5731
|
+
var PromoWithTagsText = /*#__PURE__*/styled__default.div(_templateObject3$p || (_templateObject3$p = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-family: var(--font-family-body);\n font-feature-settings: var(--font-feature-settings-body);\n font-size: var(--font-size-body-1);\n font-weight: var(--font-weight-body-1);\n line-height: var(--line-height-body-1);\n letter-spacing: var(--letter-spacing-body-1);\n text-transform: var(--text-transform-body);\n margin: 0;\n padding: 0;\n white-space: break-spaces;\n overflow-wrap: break-word;\n\n h5,\n h6 {\n margin: 0 0 4px 0;\n font-family: var(--font-family-subtitle);\n font-feature-settings: var(--font-feature-settings-subtitle);\n font-size: var(--font-size-subtitle-2);\n font-weight: var(--font-weight-subtitle-2);\n line-height: var(--line-height-subtitle-2);\n letter-spacing: var(--letter-spacing-subtitle-2);\n text-transform: var(--text-transform-subtitle);\n overflow-wrap: break-word;\n }\n\n em {\n font-family: var(--font-family-body-italics);\n }\n\n a {\n text-decoration: underline;\n cursor: pointer;\n\n &[href^='tel:'] {\n text-decoration: none;\n }\n\n &:link {\n color: ", ";\n }\n\n &:visited {\n color: ", ";\n }\n\n &:hover {\n color: ", ";\n }\n }\n"])), function (_ref3) {
|
|
5732
|
+
var theme = _ref3.theme;
|
|
5712
5733
|
return theme.colors.black;
|
|
5713
|
-
}, function (
|
|
5714
|
-
var theme =
|
|
5734
|
+
}, function (_ref4) {
|
|
5735
|
+
var theme = _ref4.theme;
|
|
5715
5736
|
return theme.colors.darkgrey;
|
|
5716
|
-
}, function (
|
|
5717
|
-
var theme =
|
|
5737
|
+
}, function (_ref5) {
|
|
5738
|
+
var theme = _ref5.theme;
|
|
5718
5739
|
return theme.colors.primary;
|
|
5719
5740
|
});
|
|
5720
|
-
var ButtonsContainer$2 = /*#__PURE__*/styled__default.div(
|
|
5721
|
-
var hasTextLinks =
|
|
5741
|
+
var ButtonsContainer$2 = /*#__PURE__*/styled__default.div(_templateObject4$j || (_templateObject4$j = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: 16px;\n margin-top: 24px;\n\n ", ";\n\n ", "\n\n @media ", " {\n gap: 24px;\n flex-direction: column;\n align-items: center;\n }\n\n @media ", " {\n gap: 24px;\n align-items: flex-start;\n\n ", "\n }\n"])), function (_ref6) {
|
|
5742
|
+
var hasTextLinks = _ref6.hasTextLinks;
|
|
5722
5743
|
return "margin-top: " + (hasTextLinks ? '0' : '24px') + ";";
|
|
5723
|
-
}, function (
|
|
5724
|
-
var
|
|
5725
|
-
primaryButtonTextLength =
|
|
5726
|
-
|
|
5727
|
-
tertiaryButtonTextLength =
|
|
5744
|
+
}, function (_ref7) {
|
|
5745
|
+
var _ref7$primaryButtonTe = _ref7.primaryButtonTextLength,
|
|
5746
|
+
primaryButtonTextLength = _ref7$primaryButtonTe === void 0 ? 0 : _ref7$primaryButtonTe,
|
|
5747
|
+
_ref7$tertiaryButtonT = _ref7.tertiaryButtonTextLength,
|
|
5748
|
+
tertiaryButtonTextLength = _ref7$tertiaryButtonT === void 0 ? 0 : _ref7$tertiaryButtonT;
|
|
5728
5749
|
var isLinksLayoutColumn = primaryButtonTextLength >= LENGTH_TEXT || tertiaryButtonTextLength >= LENGTH_TEXT;
|
|
5729
5750
|
|
|
5730
5751
|
if (isLinksLayoutColumn) {
|
|
@@ -5732,11 +5753,11 @@ var ButtonsContainer$2 = /*#__PURE__*/styled__default.div(_templateObject7$7 ||
|
|
|
5732
5753
|
}
|
|
5733
5754
|
|
|
5734
5755
|
return '';
|
|
5735
|
-
}, devices.mobile, devices.tablet, function (
|
|
5736
|
-
var
|
|
5737
|
-
primaryButtonTextLength =
|
|
5738
|
-
|
|
5739
|
-
tertiaryButtonTextLength =
|
|
5756
|
+
}, devices.mobile, devices.tablet, function (_ref8) {
|
|
5757
|
+
var _ref8$primaryButtonTe = _ref8.primaryButtonTextLength,
|
|
5758
|
+
primaryButtonTextLength = _ref8$primaryButtonTe === void 0 ? 0 : _ref8$primaryButtonTe,
|
|
5759
|
+
_ref8$tertiaryButtonT = _ref8.tertiaryButtonTextLength,
|
|
5760
|
+
tertiaryButtonTextLength = _ref8$tertiaryButtonT === void 0 ? 0 : _ref8$tertiaryButtonT;
|
|
5740
5761
|
var isLinksLayoutColumnTablet = primaryButtonTextLength >= LENGTH_TEXT_TABLET$1 || tertiaryButtonTextLength >= LENGTH_TEXT_TABLET$1;
|
|
5741
5762
|
|
|
5742
5763
|
if (isLinksLayoutColumnTablet) {
|
|
@@ -5745,22 +5766,40 @@ var ButtonsContainer$2 = /*#__PURE__*/styled__default.div(_templateObject7$7 ||
|
|
|
5745
5766
|
|
|
5746
5767
|
return '';
|
|
5747
5768
|
});
|
|
5748
|
-
var PromoWithTagsTagWrapper = /*#__PURE__*/styled__default.div(
|
|
5749
|
-
var marginBottom =
|
|
5769
|
+
var PromoWithTagsTagWrapper = /*#__PURE__*/styled__default.div(_templateObject5$e || (_templateObject5$e = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: ", ";\n"])), function (_ref9) {
|
|
5770
|
+
var marginBottom = _ref9.marginBottom;
|
|
5750
5771
|
return marginBottom + "px";
|
|
5751
5772
|
});
|
|
5752
|
-
var PromoWithTagsAdditionalText = /*#__PURE__*/styled__default(PromoWithTagsText)(
|
|
5753
|
-
var TextLinksContainer = /*#__PURE__*/styled__default.div(
|
|
5754
|
-
var TextLinkWrapper$2 = /*#__PURE__*/styled__default.div(
|
|
5755
|
-
var ExtraContentWrapper = /*#__PURE__*/styled__default.div(
|
|
5756
|
-
var IconWrapper$2 = /*#__PURE__*/styled__default.div(
|
|
5757
|
-
var PrimaryButtonWrapper$2 = /*#__PURE__*/styled__default.div(
|
|
5758
|
-
var MobileTitleWrapper = /*#__PURE__*/styled__default.div(
|
|
5773
|
+
var PromoWithTagsAdditionalText = /*#__PURE__*/styled__default(PromoWithTagsText)(_templateObject6$b || (_templateObject6$b = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: 24px 0;\n"])));
|
|
5774
|
+
var TextLinksContainer = /*#__PURE__*/styled__default.div(_templateObject7$7 || (_templateObject7$7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: wrap;\n margin: 24px 0 4px 0;\n"])));
|
|
5775
|
+
var TextLinkWrapper$2 = /*#__PURE__*/styled__default.div(_templateObject8$6 || (_templateObject8$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-right: 24px;\n margin-bottom: 20px;\n\n &:last-child {\n margin-right: 0;\n }\n"])));
|
|
5776
|
+
var ExtraContentWrapper = /*#__PURE__*/styled__default.div(_templateObject9$4 || (_templateObject9$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n padding-right: 68px;\n\n iframe {\n height: 800px;\n }\n\n @media ", " {\n padding: 30px 0 0;\n }\n\n @media ", " {\n padding: 0;\n position: initial;\n }\n"])), devices.tablet, devices.mobile);
|
|
5777
|
+
var IconWrapper$2 = /*#__PURE__*/styled__default.div(_templateObject10$3 || (_templateObject10$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: pointer;\n position: absolute;\n top: 25px;\n right: 35px;\n width: 24px;\n height: 24px;\n\n @media ", " {\n top: 30px;\n right: 30px;\n }\n\n @media ", " {\n top: 3px;\n right: 20px;\n }\n"])), devices.tablet, devices.mobile);
|
|
5778
|
+
var PrimaryButtonWrapper$2 = /*#__PURE__*/styled__default.div(_templateObject11$2 || (_templateObject11$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n height: var(--button-height);\n"])));
|
|
5779
|
+
var MobileTitleWrapper = /*#__PURE__*/styled__default.div(_templateObject12$1 || (_templateObject12$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: none;\n margin: 0 50px 0 20px;\n\n h2,\n h3 {\n margin: 0;\n }\n\n @media ", " {\n display: block;\n }\n"])), devices.mobile);
|
|
5780
|
+
var PromoWithTagsTypeTags = /*#__PURE__*/styled__default(TypeTags)(_templateObject13 || (_templateObject13 = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
5781
|
+
var PromoWithTagsHeader = /*#__PURE__*/styled__default(Header)(_templateObject14 || (_templateObject14 = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
5782
|
+
var asCardOverrides = /*#__PURE__*/styled.css(_templateObject15 || (_templateObject15 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n ", " {\n font-size: var(--font-size-subtitle-2);\n }\n\n ", " {\n font-size: var(--font-size-overline-1);\n }\n\n ", " {\n flex-direction: row;\n @media ", " {\n flex-direction: row;\n }\n }\n"])), PromoWithTagsSubtitle, PromoWithTagsTypeTags, ButtonsContainer$2, devices.tablet);
|
|
5783
|
+
var PromoWithTagsExtraContentWrapper = /*#__PURE__*/styled__default.div(_templateObject16 || (_templateObject16 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n grid-area: left;\n grid-area: ", ";\n align-self: center;\n @media ", " {\n & {\n grid-area: row1;\n }\n }\n"])), function (_ref10) {
|
|
5784
|
+
var imageToLeft = _ref10.imageToLeft;
|
|
5785
|
+
return imageToLeft ? 'left' : 'right';
|
|
5786
|
+
}, devices.mobile);
|
|
5787
|
+
var PromoWithTagsContentWrapper = /*#__PURE__*/styled__default.div(_templateObject17 || (_templateObject17 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n grid-area: ", ";\n align-self: center;\n @media ", " {\n & {\n display: ", ";\n grid-area: row2;\n align-self: start;\n }\n }\n\n ", "\n"])), function (_ref11) {
|
|
5788
|
+
var imageToLeft = _ref11.imageToLeft;
|
|
5789
|
+
return imageToLeft ? 'right' : 'left';
|
|
5790
|
+
}, devices.mobile, function (_ref12) {
|
|
5791
|
+
var hideSection = _ref12.hideSection;
|
|
5792
|
+
return hideSection ? 'none' : 'block';
|
|
5793
|
+
}, function (asCard) {
|
|
5794
|
+
return asCard && asCardOverrides;
|
|
5795
|
+
});
|
|
5796
|
+
var PromoWithTagsContainer = /*#__PURE__*/styled__default.div(_templateObject18 || (_templateObject18 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n h2,\n h3 {\n margin: 0 0 16px;\n }\n"])));
|
|
5759
5797
|
|
|
5760
5798
|
var _excluded$j = ["text"],
|
|
5761
5799
|
_excluded2$3 = ["text"],
|
|
5762
5800
|
_excluded3 = ["text"];
|
|
5763
5801
|
var LENGTH_TEXT$1 = 28;
|
|
5802
|
+
var LENGTH_TEXT_PARAGRAPH = 130;
|
|
5764
5803
|
|
|
5765
5804
|
var PromoWithTags = function PromoWithTags(_ref) {
|
|
5766
5805
|
var _ref$imagePosition = _ref.imagePosition,
|
|
@@ -5778,7 +5817,13 @@ var PromoWithTags = function PromoWithTags(_ref) {
|
|
|
5778
5817
|
belowTitleTags = _ref.belowTitleTags,
|
|
5779
5818
|
middleText = _ref.middleText,
|
|
5780
5819
|
bottomText = _ref.bottomText,
|
|
5781
|
-
image = _ref.image
|
|
5820
|
+
image = _ref.image,
|
|
5821
|
+
_ref$asCard = _ref.asCard,
|
|
5822
|
+
asCard = _ref$asCard === void 0 ? false : _ref$asCard,
|
|
5823
|
+
_ref$disableCTA = _ref.disableCTA,
|
|
5824
|
+
disableCTA = _ref$disableCTA === void 0 ? false : _ref$disableCTA,
|
|
5825
|
+
_ref$disabledCTACopy = _ref.disabledCTACopy,
|
|
5826
|
+
disabledCTACopy = _ref$disabledCTACopy === void 0 ? 'Sold Out' : _ref$disabledCTACopy;
|
|
5782
5827
|
|
|
5783
5828
|
var _useState = React.useState(false),
|
|
5784
5829
|
showExtraContent = _useState[0],
|
|
@@ -5788,8 +5833,20 @@ var PromoWithTags = function PromoWithTags(_ref) {
|
|
|
5788
5833
|
return str.length >= n ? str.substr(0, n) : str;
|
|
5789
5834
|
};
|
|
5790
5835
|
|
|
5836
|
+
var getTitleLevel = function getTitleLevel(titleSize, isCard) {
|
|
5837
|
+
if (isCard) {
|
|
5838
|
+
return 5;
|
|
5839
|
+
}
|
|
5840
|
+
|
|
5841
|
+
if (titleSize === 'large') {
|
|
5842
|
+
return 3;
|
|
5843
|
+
}
|
|
5844
|
+
|
|
5845
|
+
return 2;
|
|
5846
|
+
};
|
|
5847
|
+
|
|
5791
5848
|
var imageToLeft = imagePosition === 'left';
|
|
5792
|
-
var titleLevel = titleSize
|
|
5849
|
+
var titleLevel = getTitleLevel(titleSize, asCard);
|
|
5793
5850
|
var isExtraContentPresent = !!children;
|
|
5794
5851
|
var anchorLink = title.replace(' ', '-').toLocaleLowerCase() + "-content";
|
|
5795
5852
|
|
|
@@ -5819,6 +5876,7 @@ var PromoWithTags = function PromoWithTags(_ref) {
|
|
|
5819
5876
|
restTertiaryButton = _objectWithoutPropertiesLoose(_ref3, _excluded2$3);
|
|
5820
5877
|
|
|
5821
5878
|
var tertiaryButtonTextTruncate = truncate(tertiaryButtonText, LENGTH_TEXT$1);
|
|
5879
|
+
var textTruncate = asCard ? truncate(text || '', LENGTH_TEXT_PARAGRAPH) : text;
|
|
5822
5880
|
var textLinkItems = textLinks ? textLinks.map(function (link) {
|
|
5823
5881
|
var _link$text = link.text,
|
|
5824
5882
|
textLinkText = _link$text === void 0 ? '' : _link$text,
|
|
@@ -5828,24 +5886,28 @@ var PromoWithTags = function PromoWithTags(_ref) {
|
|
|
5828
5886
|
}) : null;
|
|
5829
5887
|
return /*#__PURE__*/React__default.createElement(PromoWithTagsGrid, {
|
|
5830
5888
|
id: anchorLink,
|
|
5831
|
-
|
|
5889
|
+
"data-testid": "grid-wrapper",
|
|
5890
|
+
imageToLeft: imageToLeft,
|
|
5891
|
+
asCard: asCard
|
|
5832
5892
|
}, /*#__PURE__*/React__default.createElement(PromoWithTagsContentWrapper, {
|
|
5833
5893
|
"data-testid": "content-wrapper",
|
|
5834
5894
|
imageToLeft: imageToLeft,
|
|
5835
|
-
hideSection: showExtraContent
|
|
5895
|
+
hideSection: showExtraContent,
|
|
5896
|
+
asCard: asCard
|
|
5836
5897
|
}, /*#__PURE__*/React__default.createElement(PromoWithTagsContainer, null, !!(aboveTitleTags != null && aboveTitleTags.length) && /*#__PURE__*/React__default.createElement(PromoWithTagsTagWrapper, {
|
|
5837
5898
|
marginBottom: 16
|
|
5838
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
5899
|
+
}, /*#__PURE__*/React__default.createElement(PromoWithTagsTypeTags, {
|
|
5839
5900
|
list: aboveTitleTags
|
|
5840
|
-
})), /*#__PURE__*/React__default.createElement(
|
|
5901
|
+
})), /*#__PURE__*/React__default.createElement(PromoWithTagsHeader, {
|
|
5902
|
+
semanticLevel: 2,
|
|
5841
5903
|
level: titleLevel
|
|
5842
5904
|
}, title)), subtitle && /*#__PURE__*/React__default.createElement(PromoWithTagsSubtitle, null, subtitle), !!(belowTitleTags != null && belowTitleTags.length) && /*#__PURE__*/React__default.createElement(PromoWithTagsTagWrapper, {
|
|
5843
5905
|
marginBottom: 8
|
|
5844
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
5906
|
+
}, /*#__PURE__*/React__default.createElement(PromoWithTagsTypeTags, {
|
|
5845
5907
|
list: belowTitleTags
|
|
5846
5908
|
})), /*#__PURE__*/React__default.createElement(PromoWithTagsText, {
|
|
5847
5909
|
dangerouslySetInnerHTML: {
|
|
5848
|
-
__html:
|
|
5910
|
+
__html: textTruncate
|
|
5849
5911
|
}
|
|
5850
5912
|
}), middleText && /*#__PURE__*/React__default.createElement(PromoWithTagsAdditionalText, {
|
|
5851
5913
|
dangerouslySetInnerHTML: {
|
|
@@ -5860,12 +5922,19 @@ var PromoWithTags = function PromoWithTags(_ref) {
|
|
|
5860
5922
|
"data-testid": "buttons-wrapper",
|
|
5861
5923
|
primaryButtonTextLength: primaryButtonText.length,
|
|
5862
5924
|
tertiaryButtonTextLength: tertiaryButtonText.length
|
|
5863
|
-
}, primaryButton && /*#__PURE__*/React__default.createElement(PrimaryButtonWrapper$2, null,
|
|
5925
|
+
}, primaryButton && /*#__PURE__*/React__default.createElement(PrimaryButtonWrapper$2, null, disableCTA ? /*#__PURE__*/React__default.createElement(PrimaryButton, {
|
|
5926
|
+
bgColor: exports.Colors.MidGrey,
|
|
5927
|
+
onClick: function onClick() {
|
|
5928
|
+
return null;
|
|
5929
|
+
},
|
|
5930
|
+
"data-testid": "diabled-link"
|
|
5931
|
+
}, disabledCTACopy || primaryButtonTextTruncate) : !showExtraContent && /*#__PURE__*/React__default.createElement(PrimaryButton, Object.assign({
|
|
5864
5932
|
onClick: defaultOnClickHandler
|
|
5865
5933
|
}, restPrimaryButton), primaryButtonTextTruncate)), tertiaryButton && /*#__PURE__*/React__default.createElement(Button$1, Object.assign({}, restTertiaryButton), tertiaryButtonTextTruncate))), /*#__PURE__*/React__default.createElement(PromoWithTagsExtraContentWrapper, {
|
|
5866
5934
|
"data-testid": "extra-content-wrapper",
|
|
5867
5935
|
imageToLeft: imageToLeft
|
|
5868
|
-
}, showExtraContent && /*#__PURE__*/React__default.createElement(MobileTitleWrapper, null, /*#__PURE__*/React__default.createElement(
|
|
5936
|
+
}, showExtraContent && /*#__PURE__*/React__default.createElement(MobileTitleWrapper, null, /*#__PURE__*/React__default.createElement(PromoWithTagsHeader, {
|
|
5937
|
+
semanticLevel: 2,
|
|
5869
5938
|
level: titleLevel
|
|
5870
5939
|
}, title)), /*#__PURE__*/React__default.createElement(ImageAspectRatioWrapper, {
|
|
5871
5940
|
aspectRatio: exports.AspectRatio['4:3']
|