@royaloperahouse/chord 2.9.1 → 2.10.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/dist/chord.esm.js CHANGED
@@ -2776,10 +2776,12 @@ var PrimaryButton = function PrimaryButton(_ref) {
2776
2776
  };
2777
2777
 
2778
2778
  var _templateObject$5;
2779
- var PrimaryButtonWrapper$1 = /*#__PURE__*/styled(Button)(_templateObject$5 || (_templateObject$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background-color: var(--base-color-transparent);\n border-color: ", ";\n"])), function (_ref) {
2779
+ var SecondaryButtonWrapper = /*#__PURE__*/styled(Button)(_templateObject$5 || (_templateObject$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background-color: var(--base-color-transparent);\n\n ", "\n"])), function (_ref) {
2780
2780
  var color = _ref.color,
2781
2781
  theme = _ref.theme;
2782
- return color ? "var(--base-color-" + color + ")" : theme.colors.primary;
2782
+ var themeColor = (theme == null ? void 0 : theme.colors) && color && theme.colors[color];
2783
+ if (!themeColor) themeColor = color ? "var(--base-color-" + color + ")" : theme.colors.primary;
2784
+ return "\n border-color: " + themeColor + ";\n color: " + themeColor + ";\n ";
2783
2785
  });
2784
2786
 
2785
2787
  var _excluded$2 = ["children"];
@@ -2788,7 +2790,7 @@ var SecondaryButton = function SecondaryButton(_ref) {
2788
2790
  var children = _ref.children,
2789
2791
  props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
2790
2792
 
2791
- return /*#__PURE__*/React__default.createElement(PrimaryButtonWrapper$1, Object.assign({
2793
+ return /*#__PURE__*/React__default.createElement(SecondaryButtonWrapper, Object.assign({
2792
2794
  color: Colors.Primary
2793
2795
  }, props), children);
2794
2796
  };
@@ -7298,7 +7300,13 @@ var PromoLabel = /*#__PURE__*/styled.div(_templateObject3$n || (_templateObject3
7298
7300
  var theme = _ref.theme;
7299
7301
  return theme.colors.primary;
7300
7302
  }, Colors.White);
7301
- var ButtonContainer = /*#__PURE__*/styled.div(_templateObject4$i || (_templateObject4$i = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-top: 2em;\n width: fit-content;\n"])));
7303
+ var ButtonContainer = /*#__PURE__*/styled.div(_templateObject4$i || (_templateObject4$i = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-top: 2em;\n width: fit-content;\n display: flex;\n flex-direction: row;\n gap: 20px;\n\n @media ", " {\n width: 100%;\n flex-direction: column;\n gap: 16px;\n }\n\n ", "\n"])), function (_ref2) {
7304
+ var stackCtasEarly = _ref2.stackCtasEarly;
7305
+ return stackCtasEarly ? devices.smallDesktop + ", " + devices.mobileAndTablet : devices.mobile;
7306
+ }, function (_ref3) {
7307
+ var stackCtasEarly = _ref3.stackCtasEarly;
7308
+ return stackCtasEarly && "\n @media " + devices.smallDesktop + ", " + devices.mobileAndTablet + " {\n * {\n width: 100%;\n }\n }\n ";
7309
+ });
7302
7310
  var TitleContainer$1 = /*#__PURE__*/styled.div(_templateObject5$d || (_templateObject5$d = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n & > * {\n margin-top: 0;\n margin-bottom: 0.5em;\n }\n"])));
7303
7311
  var OfferTextWrapper = /*#__PURE__*/styled.div(_templateObject6$b || (_templateObject6$b = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n & > * {\n margin-bottom: 0.5em;\n }\n margin-bottom: 1em;\n"])));
7304
7312
  var PriceRow = /*#__PURE__*/styled.div(_templateObject7$6 || (_templateObject7$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: wrap;\n gap: 6px 12px;\n padding: 5px 0 8px 0;\n"])));
@@ -7345,8 +7353,13 @@ var UpsellCard = function UpsellCard(_ref) {
7345
7353
  flag = _ref.flag,
7346
7354
  offerTexts = _ref.offerTexts,
7347
7355
  link = _ref.link,
7356
+ secondaryLink = _ref.secondaryLink,
7357
+ _ref$stackCtasEarly = _ref.stackCtasEarly,
7358
+ stackCtasEarly = _ref$stackCtasEarly === void 0 ? false : _ref$stackCtasEarly,
7348
7359
  _ref$theme = _ref.theme,
7349
- theme = _ref$theme === void 0 ? ThemeType.Core : _ref$theme;
7360
+ theme = _ref$theme === void 0 ? ThemeType.Core : _ref$theme,
7361
+ _ref$secondaryTheme = _ref.secondaryTheme,
7362
+ secondaryTheme = _ref$secondaryTheme === void 0 ? ThemeType.Core : _ref$secondaryTheme;
7350
7363
 
7351
7364
  var truncate = function truncate(str, n) {
7352
7365
  return str.length >= n ? str.slice(0, n) : str;
@@ -7367,12 +7380,17 @@ var UpsellCard = function UpsellCard(_ref) {
7367
7380
  level: 4
7368
7381
  }, formatPrice(promoPrice))) : /*#__PURE__*/React__default.createElement(PriceRow, null, /*#__PURE__*/React__default.createElement(AltHeader, {
7369
7382
  level: 4
7370
- }, formatPrice(price)))), (reducedOfferTexts == null ? void 0 : reducedOfferTexts.length) && reducedOfferTexts.map(function (offerText) {
7383
+ }, formatPrice(price)))), (reducedOfferTexts == null ? void 0 : reducedOfferTexts.length) && reducedOfferTexts.map(function (offerText, index) {
7371
7384
  return /*#__PURE__*/React__default.createElement(OfferText, {
7385
+ key: "offer-" + index,
7372
7386
  title: offerText.title,
7373
7387
  description: offerText.description
7374
7388
  });
7375
- }), link && /*#__PURE__*/React__default.createElement(ButtonContainer, null, /*#__PURE__*/React__default.createElement(PrimaryButton, Object.assign({}, link), truncate(link.text, LENGTH_SMALL_TEXT)))));
7389
+ }), ((link == null ? void 0 : link.text) || (secondaryLink == null ? void 0 : secondaryLink.text)) && /*#__PURE__*/React__default.createElement(ButtonContainer, {
7390
+ stackCtasEarly: stackCtasEarly
7391
+ }, (link == null ? void 0 : link.text) && /*#__PURE__*/React__default.createElement(PrimaryButton, Object.assign({}, link), truncate(link.text, LENGTH_SMALL_TEXT)), (secondaryLink == null ? void 0 : secondaryLink.text) && /*#__PURE__*/React__default.createElement(Theme, {
7392
+ theme: secondaryTheme
7393
+ }, /*#__PURE__*/React__default.createElement(SecondaryButton, Object.assign({}, secondaryLink), truncate(secondaryLink.text, LENGTH_SMALL_TEXT))))));
7376
7394
  };
7377
7395
 
7378
7396
  var _templateObject$L;
@@ -7380,8 +7398,9 @@ var Wrapper$3 = /*#__PURE__*/styled.div(_templateObject$L || (_templateObject$L
7380
7398
 
7381
7399
  var UpsellCards = function UpsellCards(_ref) {
7382
7400
  var upsellCards = _ref.upsellCards;
7383
- return /*#__PURE__*/React__default.createElement(Wrapper$3, null, upsellCards == null ? void 0 : upsellCards.map(function (card) {
7401
+ return /*#__PURE__*/React__default.createElement(Wrapper$3, null, upsellCards == null ? void 0 : upsellCards.map(function (card, index) {
7384
7402
  return /*#__PURE__*/React__default.createElement(UpsellCard, {
7403
+ key: "card-" + index,
7385
7404
  title: card.title,
7386
7405
  subTitle: card.subTitle,
7387
7406
  price: card.price,
@@ -7389,7 +7408,10 @@ var UpsellCards = function UpsellCards(_ref) {
7389
7408
  flag: card.flag,
7390
7409
  offerTexts: card.offerTexts,
7391
7410
  link: card.link,
7392
- theme: card.theme
7411
+ secondaryLink: card.secondaryLink,
7412
+ stackCtasEarly: true,
7413
+ theme: card.theme,
7414
+ secondaryTheme: card.secondaryTheme
7393
7415
  });
7394
7416
  }));
7395
7417
  };
@@ -9240,7 +9262,7 @@ var TextLinksContainer = /*#__PURE__*/styled.div(_templateObject7$d || (_templat
9240
9262
  var TextLinkWrapper$2 = /*#__PURE__*/styled.div(_templateObject8$a || (_templateObject8$a = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-right: 24px;\n margin-bottom: 20px;\n\n &:last-child {\n margin-right: 0;\n }\n"])));
9241
9263
  var ExtraContentWrapper = /*#__PURE__*/styled.div(_templateObject9$5 || (_templateObject9$5 = /*#__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);
9242
9264
  var IconWrapper$2 = /*#__PURE__*/styled.div(_templateObject10$5 || (_templateObject10$5 = /*#__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);
9243
- var PrimaryButtonWrapper$2 = /*#__PURE__*/styled.div(_templateObject11$2 || (_templateObject11$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n height: var(--button-height);\n\n @media ", " {\n width: 100%;\n }\n"])), devices.mobile);
9265
+ var PrimaryButtonWrapper$1 = /*#__PURE__*/styled.div(_templateObject11$2 || (_templateObject11$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n height: var(--button-height);\n\n @media ", " {\n width: 100%;\n }\n"])), devices.mobile);
9244
9266
  var MobileTitleWrapper = /*#__PURE__*/styled.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);
9245
9267
  var PromoWithTagsTypeTags = /*#__PURE__*/styled(TypeTags)(_templateObject13$1 || (_templateObject13$1 = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9246
9268
  var PromoWithTagsHeader = /*#__PURE__*/styled(Header)(_templateObject14$1 || (_templateObject14$1 = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
@@ -9422,7 +9444,7 @@ var PromoWithTags = function PromoWithTags(_ref) {
9422
9444
  "data-testid": "buttons-wrapper",
9423
9445
  primaryButtonTextLength: firstButtonText.length,
9424
9446
  tertiaryButtonTextLength: secondButtonText.length
9425
- }, firstButton && /*#__PURE__*/React__default.createElement(PrimaryButtonWrapper$2, null, disableCTA ? /*#__PURE__*/React__default.createElement(FirstButtonComponent, {
9447
+ }, firstButton && /*#__PURE__*/React__default.createElement(PrimaryButtonWrapper$1, null, disableCTA ? /*#__PURE__*/React__default.createElement(FirstButtonComponent, {
9426
9448
  bgColor: Colors.MidGrey,
9427
9449
  onClick: function onClick() {
9428
9450
  return null;
@@ -11761,7 +11783,8 @@ var UpsellSection = function UpsellSection(_ref) {
11761
11783
  theme = _ref$theme === void 0 ? ThemeType.Core : _ref$theme;
11762
11784
  var themedUpsellCards = upsellCards ? [].concat(upsellCards).map(function (card) {
11763
11785
  return _extends({}, card, {
11764
- theme: card.theme || theme
11786
+ theme: card.theme || theme,
11787
+ secondaryTheme: card.secondaryTheme || theme
11765
11788
  });
11766
11789
  }) : [];
11767
11790
  return /*#__PURE__*/React__default.createElement(Theme, {