@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/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [2.10.0]
2
+ - Upsell Card, Upsell Cards, Upsell section:
3
+ - Add secondary CTA
4
+ - Update device styling
5
+
1
6
  ## [2.9.1]
2
7
  - AnchorBar and SignUpForm accessibility bug fixes
3
8
 
@@ -2771,10 +2771,12 @@ var PrimaryButton = function PrimaryButton(_ref) {
2771
2771
  };
2772
2772
 
2773
2773
  var _templateObject$5;
2774
- var PrimaryButtonWrapper$1 = /*#__PURE__*/styled__default(Button)(_templateObject$5 || (_templateObject$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background-color: var(--base-color-transparent);\n border-color: ", ";\n"])), function (_ref) {
2774
+ var SecondaryButtonWrapper = /*#__PURE__*/styled__default(Button)(_templateObject$5 || (_templateObject$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background-color: var(--base-color-transparent);\n\n ", "\n"])), function (_ref) {
2775
2775
  var color = _ref.color,
2776
2776
  theme = _ref.theme;
2777
- return color ? "var(--base-color-" + color + ")" : theme.colors.primary;
2777
+ var themeColor = (theme == null ? void 0 : theme.colors) && color && theme.colors[color];
2778
+ if (!themeColor) themeColor = color ? "var(--base-color-" + color + ")" : theme.colors.primary;
2779
+ return "\n border-color: " + themeColor + ";\n color: " + themeColor + ";\n ";
2778
2780
  });
2779
2781
 
2780
2782
  var _excluded$2 = ["children"];
@@ -2783,7 +2785,7 @@ var SecondaryButton = function SecondaryButton(_ref) {
2783
2785
  var children = _ref.children,
2784
2786
  props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
2785
2787
 
2786
- return /*#__PURE__*/React__default.createElement(PrimaryButtonWrapper$1, Object.assign({
2788
+ return /*#__PURE__*/React__default.createElement(SecondaryButtonWrapper, Object.assign({
2787
2789
  color: exports.Colors.Primary
2788
2790
  }, props), children);
2789
2791
  };
@@ -7293,7 +7295,13 @@ var PromoLabel = /*#__PURE__*/styled__default.div(_templateObject3$n || (_templa
7293
7295
  var theme = _ref.theme;
7294
7296
  return theme.colors.primary;
7295
7297
  }, exports.Colors.White);
7296
- var ButtonContainer = /*#__PURE__*/styled__default.div(_templateObject4$i || (_templateObject4$i = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-top: 2em;\n width: fit-content;\n"])));
7298
+ var ButtonContainer = /*#__PURE__*/styled__default.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) {
7299
+ var stackCtasEarly = _ref2.stackCtasEarly;
7300
+ return stackCtasEarly ? devices.smallDesktop + ", " + devices.mobileAndTablet : devices.mobile;
7301
+ }, function (_ref3) {
7302
+ var stackCtasEarly = _ref3.stackCtasEarly;
7303
+ return stackCtasEarly && "\n @media " + devices.smallDesktop + ", " + devices.mobileAndTablet + " {\n * {\n width: 100%;\n }\n }\n ";
7304
+ });
7297
7305
  var TitleContainer$1 = /*#__PURE__*/styled__default.div(_templateObject5$d || (_templateObject5$d = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n & > * {\n margin-top: 0;\n margin-bottom: 0.5em;\n }\n"])));
7298
7306
  var OfferTextWrapper = /*#__PURE__*/styled__default.div(_templateObject6$b || (_templateObject6$b = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n & > * {\n margin-bottom: 0.5em;\n }\n margin-bottom: 1em;\n"])));
7299
7307
  var PriceRow = /*#__PURE__*/styled__default.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"])));
@@ -7340,8 +7348,13 @@ var UpsellCard = function UpsellCard(_ref) {
7340
7348
  flag = _ref.flag,
7341
7349
  offerTexts = _ref.offerTexts,
7342
7350
  link = _ref.link,
7351
+ secondaryLink = _ref.secondaryLink,
7352
+ _ref$stackCtasEarly = _ref.stackCtasEarly,
7353
+ stackCtasEarly = _ref$stackCtasEarly === void 0 ? false : _ref$stackCtasEarly,
7343
7354
  _ref$theme = _ref.theme,
7344
- theme = _ref$theme === void 0 ? exports.ThemeType.Core : _ref$theme;
7355
+ theme = _ref$theme === void 0 ? exports.ThemeType.Core : _ref$theme,
7356
+ _ref$secondaryTheme = _ref.secondaryTheme,
7357
+ secondaryTheme = _ref$secondaryTheme === void 0 ? exports.ThemeType.Core : _ref$secondaryTheme;
7345
7358
 
7346
7359
  var truncate = function truncate(str, n) {
7347
7360
  return str.length >= n ? str.slice(0, n) : str;
@@ -7362,12 +7375,17 @@ var UpsellCard = function UpsellCard(_ref) {
7362
7375
  level: 4
7363
7376
  }, formatPrice(promoPrice))) : /*#__PURE__*/React__default.createElement(PriceRow, null, /*#__PURE__*/React__default.createElement(AltHeader, {
7364
7377
  level: 4
7365
- }, formatPrice(price)))), (reducedOfferTexts == null ? void 0 : reducedOfferTexts.length) && reducedOfferTexts.map(function (offerText) {
7378
+ }, formatPrice(price)))), (reducedOfferTexts == null ? void 0 : reducedOfferTexts.length) && reducedOfferTexts.map(function (offerText, index) {
7366
7379
  return /*#__PURE__*/React__default.createElement(OfferText, {
7380
+ key: "offer-" + index,
7367
7381
  title: offerText.title,
7368
7382
  description: offerText.description
7369
7383
  });
7370
- }), link && /*#__PURE__*/React__default.createElement(ButtonContainer, null, /*#__PURE__*/React__default.createElement(PrimaryButton, Object.assign({}, link), truncate(link.text, LENGTH_SMALL_TEXT)))));
7384
+ }), ((link == null ? void 0 : link.text) || (secondaryLink == null ? void 0 : secondaryLink.text)) && /*#__PURE__*/React__default.createElement(ButtonContainer, {
7385
+ stackCtasEarly: stackCtasEarly
7386
+ }, (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, {
7387
+ theme: secondaryTheme
7388
+ }, /*#__PURE__*/React__default.createElement(SecondaryButton, Object.assign({}, secondaryLink), truncate(secondaryLink.text, LENGTH_SMALL_TEXT))))));
7371
7389
  };
7372
7390
 
7373
7391
  var _templateObject$L;
@@ -7375,8 +7393,9 @@ var Wrapper$3 = /*#__PURE__*/styled__default.div(_templateObject$L || (_template
7375
7393
 
7376
7394
  var UpsellCards = function UpsellCards(_ref) {
7377
7395
  var upsellCards = _ref.upsellCards;
7378
- return /*#__PURE__*/React__default.createElement(Wrapper$3, null, upsellCards == null ? void 0 : upsellCards.map(function (card) {
7396
+ return /*#__PURE__*/React__default.createElement(Wrapper$3, null, upsellCards == null ? void 0 : upsellCards.map(function (card, index) {
7379
7397
  return /*#__PURE__*/React__default.createElement(UpsellCard, {
7398
+ key: "card-" + index,
7380
7399
  title: card.title,
7381
7400
  subTitle: card.subTitle,
7382
7401
  price: card.price,
@@ -7384,7 +7403,10 @@ var UpsellCards = function UpsellCards(_ref) {
7384
7403
  flag: card.flag,
7385
7404
  offerTexts: card.offerTexts,
7386
7405
  link: card.link,
7387
- theme: card.theme
7406
+ secondaryLink: card.secondaryLink,
7407
+ stackCtasEarly: true,
7408
+ theme: card.theme,
7409
+ secondaryTheme: card.secondaryTheme
7388
7410
  });
7389
7411
  }));
7390
7412
  };
@@ -9235,7 +9257,7 @@ var TextLinksContainer = /*#__PURE__*/styled__default.div(_templateObject7$d ||
9235
9257
  var TextLinkWrapper$2 = /*#__PURE__*/styled__default.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"])));
9236
9258
  var ExtraContentWrapper = /*#__PURE__*/styled__default.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);
9237
9259
  var IconWrapper$2 = /*#__PURE__*/styled__default.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);
9238
- var PrimaryButtonWrapper$2 = /*#__PURE__*/styled__default.div(_templateObject11$2 || (_templateObject11$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n height: var(--button-height);\n\n @media ", " {\n width: 100%;\n }\n"])), devices.mobile);
9260
+ var PrimaryButtonWrapper$1 = /*#__PURE__*/styled__default.div(_templateObject11$2 || (_templateObject11$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n height: var(--button-height);\n\n @media ", " {\n width: 100%;\n }\n"])), devices.mobile);
9239
9261
  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);
9240
9262
  var PromoWithTagsTypeTags = /*#__PURE__*/styled__default(TypeTags)(_templateObject13$1 || (_templateObject13$1 = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9241
9263
  var PromoWithTagsHeader = /*#__PURE__*/styled__default(Header)(_templateObject14$1 || (_templateObject14$1 = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
@@ -9417,7 +9439,7 @@ var PromoWithTags = function PromoWithTags(_ref) {
9417
9439
  "data-testid": "buttons-wrapper",
9418
9440
  primaryButtonTextLength: firstButtonText.length,
9419
9441
  tertiaryButtonTextLength: secondButtonText.length
9420
- }, firstButton && /*#__PURE__*/React__default.createElement(PrimaryButtonWrapper$2, null, disableCTA ? /*#__PURE__*/React__default.createElement(FirstButtonComponent, {
9442
+ }, firstButton && /*#__PURE__*/React__default.createElement(PrimaryButtonWrapper$1, null, disableCTA ? /*#__PURE__*/React__default.createElement(FirstButtonComponent, {
9421
9443
  bgColor: exports.Colors.MidGrey,
9422
9444
  onClick: function onClick() {
9423
9445
  return null;
@@ -11756,7 +11778,8 @@ var UpsellSection = function UpsellSection(_ref) {
11756
11778
  theme = _ref$theme === void 0 ? exports.ThemeType.Core : _ref$theme;
11757
11779
  var themedUpsellCards = upsellCards ? [].concat(upsellCards).map(function (card) {
11758
11780
  return _extends({}, card, {
11759
- theme: card.theme || theme
11781
+ theme: card.theme || theme,
11782
+ secondaryTheme: card.secondaryTheme || theme
11760
11783
  });
11761
11784
  }) : [];
11762
11785
  return /*#__PURE__*/React__default.createElement(Theme, {