@royaloperahouse/chord 1.2.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 +3 -0
- package/README.md +99 -44
- package/dist/chord.cjs.development.js +116 -60
- 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 +117 -61
- 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/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",
|
|
@@ -5585,6 +5594,7 @@ var PageHeadingImpact = function PageHeadingImpact(_ref) {
|
|
|
5585
5594
|
link = _ref.link,
|
|
5586
5595
|
_ref$sponsor = _ref.sponsor,
|
|
5587
5596
|
sponsor = _ref$sponsor === void 0 ? true : _ref$sponsor,
|
|
5597
|
+
customSponsorData = _ref.customSponsorData,
|
|
5588
5598
|
scrollHref = _ref.scrollHref,
|
|
5589
5599
|
bgUrlDesktop = _ref.bgUrlDesktop,
|
|
5590
5600
|
bgUrlDevice = _ref.bgUrlDevice;
|
|
@@ -5600,7 +5610,11 @@ var PageHeadingImpact = function PageHeadingImpact(_ref) {
|
|
|
5600
5610
|
"data-testid": "impact-wrapper"
|
|
5601
5611
|
}, sponsor ? /*#__PURE__*/React__default.createElement(SponsorWrapper, {
|
|
5602
5612
|
"data-testid": "impact-sponsor"
|
|
5603
|
-
},
|
|
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, {
|
|
5604
5618
|
"data-testid": "impact-logo"
|
|
5605
5619
|
}, children) : null, text ? /*#__PURE__*/React__default.createElement(TextWrapper$1, {
|
|
5606
5620
|
"data-testid": "impact-text"
|
|
@@ -5697,47 +5711,41 @@ var PeopleListing = function PeopleListing(_ref) {
|
|
|
5697
5711
|
}));
|
|
5698
5712
|
};
|
|
5699
5713
|
|
|
5700
|
-
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;
|
|
5701
5715
|
var LENGTH_TEXT = 28;
|
|
5702
|
-
var LENGTH_TEXT_TABLET$1 =
|
|
5703
|
-
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) {
|
|
5704
5722
|
var imageToLeft = _ref.imageToLeft;
|
|
5705
|
-
return imageToLeft ?
|
|
5723
|
+
return imageToLeft ? GridTemplateImageToLeft : GridTemplateImageToRight;
|
|
5706
5724
|
}, devices.tablet, function (_ref2) {
|
|
5707
5725
|
var imageToLeft = _ref2.imageToLeft;
|
|
5708
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'";
|
|
5709
|
-
}, devices.mobile)
|
|
5710
|
-
|
|
5711
|
-
var imageToLeft = _ref3.imageToLeft;
|
|
5712
|
-
return imageToLeft ? 'left' : 'right';
|
|
5713
|
-
}, devices.mobile);
|
|
5714
|
-
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) {
|
|
5715
|
-
var imageToLeft = _ref4.imageToLeft;
|
|
5716
|
-
return imageToLeft ? 'right' : 'left';
|
|
5717
|
-
}, devices.mobile, function (_ref5) {
|
|
5718
|
-
var hideSection = _ref5.hideSection;
|
|
5719
|
-
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 " : "";
|
|
5720
5729
|
});
|
|
5721
|
-
var
|
|
5722
|
-
var
|
|
5723
|
-
var
|
|
5724
|
-
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;
|
|
5725
5733
|
return theme.colors.black;
|
|
5726
|
-
}, function (
|
|
5727
|
-
var theme =
|
|
5734
|
+
}, function (_ref4) {
|
|
5735
|
+
var theme = _ref4.theme;
|
|
5728
5736
|
return theme.colors.darkgrey;
|
|
5729
|
-
}, function (
|
|
5730
|
-
var theme =
|
|
5737
|
+
}, function (_ref5) {
|
|
5738
|
+
var theme = _ref5.theme;
|
|
5731
5739
|
return theme.colors.primary;
|
|
5732
5740
|
});
|
|
5733
|
-
var ButtonsContainer$2 = /*#__PURE__*/styled__default.div(
|
|
5734
|
-
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;
|
|
5735
5743
|
return "margin-top: " + (hasTextLinks ? '0' : '24px') + ";";
|
|
5736
|
-
}, function (
|
|
5737
|
-
var
|
|
5738
|
-
primaryButtonTextLength =
|
|
5739
|
-
|
|
5740
|
-
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;
|
|
5741
5749
|
var isLinksLayoutColumn = primaryButtonTextLength >= LENGTH_TEXT || tertiaryButtonTextLength >= LENGTH_TEXT;
|
|
5742
5750
|
|
|
5743
5751
|
if (isLinksLayoutColumn) {
|
|
@@ -5745,11 +5753,11 @@ var ButtonsContainer$2 = /*#__PURE__*/styled__default.div(_templateObject7$7 ||
|
|
|
5745
5753
|
}
|
|
5746
5754
|
|
|
5747
5755
|
return '';
|
|
5748
|
-
}, devices.mobile, devices.tablet, function (
|
|
5749
|
-
var
|
|
5750
|
-
primaryButtonTextLength =
|
|
5751
|
-
|
|
5752
|
-
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;
|
|
5753
5761
|
var isLinksLayoutColumnTablet = primaryButtonTextLength >= LENGTH_TEXT_TABLET$1 || tertiaryButtonTextLength >= LENGTH_TEXT_TABLET$1;
|
|
5754
5762
|
|
|
5755
5763
|
if (isLinksLayoutColumnTablet) {
|
|
@@ -5758,22 +5766,40 @@ var ButtonsContainer$2 = /*#__PURE__*/styled__default.div(_templateObject7$7 ||
|
|
|
5758
5766
|
|
|
5759
5767
|
return '';
|
|
5760
5768
|
});
|
|
5761
|
-
var PromoWithTagsTagWrapper = /*#__PURE__*/styled__default.div(
|
|
5762
|
-
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;
|
|
5763
5771
|
return marginBottom + "px";
|
|
5764
5772
|
});
|
|
5765
|
-
var PromoWithTagsAdditionalText = /*#__PURE__*/styled__default(PromoWithTagsText)(
|
|
5766
|
-
var TextLinksContainer = /*#__PURE__*/styled__default.div(
|
|
5767
|
-
var TextLinkWrapper$2 = /*#__PURE__*/styled__default.div(
|
|
5768
|
-
var ExtraContentWrapper = /*#__PURE__*/styled__default.div(
|
|
5769
|
-
var IconWrapper$2 = /*#__PURE__*/styled__default.div(
|
|
5770
|
-
var PrimaryButtonWrapper$2 = /*#__PURE__*/styled__default.div(
|
|
5771
|
-
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"])));
|
|
5772
5797
|
|
|
5773
5798
|
var _excluded$j = ["text"],
|
|
5774
5799
|
_excluded2$3 = ["text"],
|
|
5775
5800
|
_excluded3 = ["text"];
|
|
5776
5801
|
var LENGTH_TEXT$1 = 28;
|
|
5802
|
+
var LENGTH_TEXT_PARAGRAPH = 130;
|
|
5777
5803
|
|
|
5778
5804
|
var PromoWithTags = function PromoWithTags(_ref) {
|
|
5779
5805
|
var _ref$imagePosition = _ref.imagePosition,
|
|
@@ -5791,7 +5817,13 @@ var PromoWithTags = function PromoWithTags(_ref) {
|
|
|
5791
5817
|
belowTitleTags = _ref.belowTitleTags,
|
|
5792
5818
|
middleText = _ref.middleText,
|
|
5793
5819
|
bottomText = _ref.bottomText,
|
|
5794
|
-
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;
|
|
5795
5827
|
|
|
5796
5828
|
var _useState = React.useState(false),
|
|
5797
5829
|
showExtraContent = _useState[0],
|
|
@@ -5801,8 +5833,20 @@ var PromoWithTags = function PromoWithTags(_ref) {
|
|
|
5801
5833
|
return str.length >= n ? str.substr(0, n) : str;
|
|
5802
5834
|
};
|
|
5803
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
|
+
|
|
5804
5848
|
var imageToLeft = imagePosition === 'left';
|
|
5805
|
-
var titleLevel = titleSize
|
|
5849
|
+
var titleLevel = getTitleLevel(titleSize, asCard);
|
|
5806
5850
|
var isExtraContentPresent = !!children;
|
|
5807
5851
|
var anchorLink = title.replace(' ', '-').toLocaleLowerCase() + "-content";
|
|
5808
5852
|
|
|
@@ -5832,6 +5876,7 @@ var PromoWithTags = function PromoWithTags(_ref) {
|
|
|
5832
5876
|
restTertiaryButton = _objectWithoutPropertiesLoose(_ref3, _excluded2$3);
|
|
5833
5877
|
|
|
5834
5878
|
var tertiaryButtonTextTruncate = truncate(tertiaryButtonText, LENGTH_TEXT$1);
|
|
5879
|
+
var textTruncate = asCard ? truncate(text || '', LENGTH_TEXT_PARAGRAPH) : text;
|
|
5835
5880
|
var textLinkItems = textLinks ? textLinks.map(function (link) {
|
|
5836
5881
|
var _link$text = link.text,
|
|
5837
5882
|
textLinkText = _link$text === void 0 ? '' : _link$text,
|
|
@@ -5841,24 +5886,28 @@ var PromoWithTags = function PromoWithTags(_ref) {
|
|
|
5841
5886
|
}) : null;
|
|
5842
5887
|
return /*#__PURE__*/React__default.createElement(PromoWithTagsGrid, {
|
|
5843
5888
|
id: anchorLink,
|
|
5844
|
-
|
|
5889
|
+
"data-testid": "grid-wrapper",
|
|
5890
|
+
imageToLeft: imageToLeft,
|
|
5891
|
+
asCard: asCard
|
|
5845
5892
|
}, /*#__PURE__*/React__default.createElement(PromoWithTagsContentWrapper, {
|
|
5846
5893
|
"data-testid": "content-wrapper",
|
|
5847
5894
|
imageToLeft: imageToLeft,
|
|
5848
|
-
hideSection: showExtraContent
|
|
5895
|
+
hideSection: showExtraContent,
|
|
5896
|
+
asCard: asCard
|
|
5849
5897
|
}, /*#__PURE__*/React__default.createElement(PromoWithTagsContainer, null, !!(aboveTitleTags != null && aboveTitleTags.length) && /*#__PURE__*/React__default.createElement(PromoWithTagsTagWrapper, {
|
|
5850
5898
|
marginBottom: 16
|
|
5851
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
5899
|
+
}, /*#__PURE__*/React__default.createElement(PromoWithTagsTypeTags, {
|
|
5852
5900
|
list: aboveTitleTags
|
|
5853
|
-
})), /*#__PURE__*/React__default.createElement(
|
|
5901
|
+
})), /*#__PURE__*/React__default.createElement(PromoWithTagsHeader, {
|
|
5902
|
+
semanticLevel: 2,
|
|
5854
5903
|
level: titleLevel
|
|
5855
5904
|
}, title)), subtitle && /*#__PURE__*/React__default.createElement(PromoWithTagsSubtitle, null, subtitle), !!(belowTitleTags != null && belowTitleTags.length) && /*#__PURE__*/React__default.createElement(PromoWithTagsTagWrapper, {
|
|
5856
5905
|
marginBottom: 8
|
|
5857
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
5906
|
+
}, /*#__PURE__*/React__default.createElement(PromoWithTagsTypeTags, {
|
|
5858
5907
|
list: belowTitleTags
|
|
5859
5908
|
})), /*#__PURE__*/React__default.createElement(PromoWithTagsText, {
|
|
5860
5909
|
dangerouslySetInnerHTML: {
|
|
5861
|
-
__html:
|
|
5910
|
+
__html: textTruncate
|
|
5862
5911
|
}
|
|
5863
5912
|
}), middleText && /*#__PURE__*/React__default.createElement(PromoWithTagsAdditionalText, {
|
|
5864
5913
|
dangerouslySetInnerHTML: {
|
|
@@ -5873,12 +5922,19 @@ var PromoWithTags = function PromoWithTags(_ref) {
|
|
|
5873
5922
|
"data-testid": "buttons-wrapper",
|
|
5874
5923
|
primaryButtonTextLength: primaryButtonText.length,
|
|
5875
5924
|
tertiaryButtonTextLength: tertiaryButtonText.length
|
|
5876
|
-
}, 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({
|
|
5877
5932
|
onClick: defaultOnClickHandler
|
|
5878
5933
|
}, restPrimaryButton), primaryButtonTextTruncate)), tertiaryButton && /*#__PURE__*/React__default.createElement(Button$1, Object.assign({}, restTertiaryButton), tertiaryButtonTextTruncate))), /*#__PURE__*/React__default.createElement(PromoWithTagsExtraContentWrapper, {
|
|
5879
5934
|
"data-testid": "extra-content-wrapper",
|
|
5880
5935
|
imageToLeft: imageToLeft
|
|
5881
|
-
}, 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,
|
|
5882
5938
|
level: titleLevel
|
|
5883
5939
|
}, title)), /*#__PURE__*/React__default.createElement(ImageAspectRatioWrapper, {
|
|
5884
5940
|
aspectRatio: exports.AspectRatio['4:3']
|