@royaloperahouse/chord 2.1.4-a-chord-development → 2.1.4-c

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.
@@ -1581,6 +1581,21 @@ var Twitter = (function (_ref) {
1581
1581
  }));
1582
1582
  });
1583
1583
 
1584
+ var X = (function (_ref) {
1585
+ var _ref$color = _ref.color,
1586
+ color = _ref$color === void 0 ? '#1A1A1A' : _ref$color;
1587
+ return /*#__PURE__*/React.createElement("svg", {
1588
+ width: "100%",
1589
+ height: "100%",
1590
+ viewBox: "0 0 24 24",
1591
+ fill: "none",
1592
+ xmlns: "http://www.w3.org/2000/svg"
1593
+ }, /*#__PURE__*/React.createElement("path", {
1594
+ d: "M13.7124 10.6179L20.4133 3H18.8254L13.007 9.61448L8.35992 3H3L10.0274 13.0023L3 20.9908H4.58799L10.7324 14.0056L15.6401 20.9908H21L13.7124 10.6179ZM11.5375 13.0904L10.8255 12.0944L5.16016 4.16911H7.59922L12.1712 10.5651L12.8832 11.5611L18.8262 19.8748H16.3871L11.5375 13.0904Z",
1595
+ fill: color
1596
+ }));
1597
+ });
1598
+
1584
1599
  var Youtube = (function (_ref) {
1585
1600
  var _ref$color = _ref.color,
1586
1601
  color = _ref$color === void 0 ? '#1A1A1A' : _ref$color;
@@ -2135,6 +2150,7 @@ var IconLibrary = {
2135
2150
  UserSignedIn: UserSignedIn,
2136
2151
  Volume: Volume,
2137
2152
  Watch: Watch,
2153
+ X: X,
2138
2154
  Youtube: Youtube
2139
2155
  };
2140
2156
 
@@ -2441,7 +2457,8 @@ var ControlledDropdown = function ControlledDropdown(_ref) {
2441
2457
  tabIndex: 0,
2442
2458
  onBlur: function onBlur() {
2443
2459
  return handleOptionBlur(index);
2444
- }
2460
+ },
2461
+ href: optionItem.optionLink
2445
2462
  }, optionItem.option);
2446
2463
  })) : null) : /*#__PURE__*/React__default.createElement(ControlledDropdownHeaderContainerLink, Object.assign({
2447
2464
  active: active,
@@ -4140,14 +4157,16 @@ var NavigationWrapper = /*#__PURE__*/styled__default.div(_templateObject$v || (_
4140
4157
  });
4141
4158
  var FullScreenContainer = /*#__PURE__*/styled__default.div(_templateObject2$i || (_templateObject2$i = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background-color: var(--base-color-black);\n width: 100vw;\n position: absolute;\n z-index: ", ";\n opacity: 0.4;\n"])), zIndexes.searchOverlay);
4142
4159
  var NavigationGrid = /*#__PURE__*/styled__default(Grid)(_templateObject3$c || (_templateObject3$c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n background-color: var(--base-color-white);\n height: 140px;\n z-index: ", ";\n\n @media ", " {\n height: 80px;\n }\n"])), zIndexes.navigation, devices.mobile);
4143
- var SearchBackground = /*#__PURE__*/styled__default.div(_templateObject4$9 || (_templateObject4$9 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n visibility: ", ";\n background-color: var(--base-color-white);\n height: 100px;\n border-top: 1px solid var(--base-color-light-grey);\n width: 100%;\n position: absolute;\n top: 140px;\n z-index: ", ";\n\n @media ", " {\n height: 100%;\n top: 80px;\n }\n"])), function (props) {
4144
- return props.visibility ? 'visible' : 'hidden';
4160
+ var SearchBackground = /*#__PURE__*/styled__default.div(_templateObject4$9 || (_templateObject4$9 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n visibility: ", ";\n background-color: var(--base-color-white);\n height: 100px;\n border-top: 1px solid var(--base-color-light-grey);\n width: 100%;\n position: absolute;\n top: 140px;\n z-index: ", ";\n\n @media ", " {\n height: 100%;\n top: 80px;\n }\n"])), function (_ref2) {
4161
+ var visible = _ref2.visible;
4162
+ return visible ? 'visible' : 'hidden';
4145
4163
  }, zIndexes.search, devices.mobile);
4146
- var GridItemSearch = /*#__PURE__*/styled__default(GridItem)(_templateObject5$5 || (_templateObject5$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n visibility: ", ";\n background-color: var(--base-color-white);\n border-top: 1px solid var(--base-color-light-grey);\n width: 100%;\n position: absolute;\n top: 140px;\n z-index: ", ";\n height: 100px;\n\n @media ", " {\n height: 100%;\n top: 80px;\n }\n"])), function (props) {
4147
- return props.visibility ? 'visible' : 'hidden';
4164
+ var GridItemSearch = /*#__PURE__*/styled__default(GridItem)(_templateObject5$5 || (_templateObject5$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n visibility: ", ";\n background-color: var(--base-color-white);\n border-top: 1px solid var(--base-color-light-grey);\n width: 100%;\n position: absolute;\n top: 140px;\n z-index: ", ";\n height: 100px;\n\n @media ", " {\n height: 100%;\n top: 80px;\n }\n"])), function (_ref3) {
4165
+ var visibile = _ref3.visibile;
4166
+ return visibile ? 'visible' : 'hidden';
4148
4167
  }, zIndexes.search, devices.mobile);
4149
- var NavigationGridMobile = /*#__PURE__*/styled__default(Grid)(_templateObject6$2 || (_templateObject6$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: none;\n\n @media ", " {\n display: grid;\n background-color: var(--base-color-white);\n padding-top: ", ";\n padding-bottom: var(--navigation-large-margin);\n }\n"])), devices.mobileAndTablet, function (_ref2) {
4150
- var theme = _ref2.theme;
4168
+ var NavigationGridMobile = /*#__PURE__*/styled__default(Grid)(_templateObject6$2 || (_templateObject6$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: none;\n\n @media ", " {\n display: grid;\n background-color: var(--base-color-white);\n padding-top: ", ";\n padding-bottom: var(--navigation-large-margin);\n }\n"])), devices.mobileAndTablet, function (_ref4) {
4169
+ var theme = _ref4.theme;
4151
4170
  return theme.spacing[12];
4152
4171
  });
4153
4172
  var LogoContainer = /*#__PURE__*/styled__default.div(_templateObject7$2 || (_templateObject7$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n height: 140px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n &&& .logoImg {\n height: 96px;\n width: 66px;\n }\n\n @media ", " {\n height: 80px;\n\n &&& .logoImg {\n width: 100%;\n height: 64px;\n }\n }\n"])), devices.mobile);
@@ -4579,7 +4598,8 @@ var Dropdown = function Dropdown(_ref) {
4579
4598
  return onKeyDownHandler(e, optionItem.optionLink);
4580
4599
  },
4581
4600
  colorPrimary: colorPrimary,
4582
- tabIndex: 0
4601
+ tabIndex: 0,
4602
+ href: optionItem.optionLink
4583
4603
  }, optionItem.option);
4584
4604
  })));
4585
4605
  };
@@ -5029,9 +5049,9 @@ var Navigation = function Navigation(_ref) {
5029
5049
  onShowMenu: onShowMenuHandler,
5030
5050
  colorPrimary: 'navigation'
5031
5051
  })))), /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(SearchBackground, {
5032
- visibility: showSearch
5052
+ visible: showSearch
5033
5053
  }), /*#__PURE__*/React__default.createElement(GridItemSearch, {
5034
- visibility: showSearch,
5054
+ visible: showSearch,
5035
5055
  columnStartDesktop: 2,
5036
5056
  columnSpanDesktop: 14,
5037
5057
  columnStartDevice: 2,
@@ -5659,20 +5679,29 @@ var Accordion = function Accordion(_ref) {
5659
5679
  return visibleStandfirst ? /*#__PURE__*/React__default.createElement(ContentContainer, null, /*#__PURE__*/React__default.createElement(ChildrenContainer, null, visibleStandfirst)) : null;
5660
5680
  };
5661
5681
 
5662
- return /*#__PURE__*/React__default.createElement(AccordionContainer, null, /*#__PURE__*/React__default.createElement(LineContainer, null), /*#__PURE__*/React__default.createElement(TitleContainer$3, {
5682
+ var contentContainerId = title + "-accordion-content";
5683
+ return /*#__PURE__*/React__default.createElement(AccordionContainer, {
5684
+ tabIndex: 0,
5685
+ onKeyDown: keyDown
5686
+ }, /*#__PURE__*/React__default.createElement(LineContainer, null), /*#__PURE__*/React__default.createElement(TitleContainer$3, {
5663
5687
  onClick: toggleAccordion,
5664
- onKeyDown: keyDown,
5665
- tabIndex: 0
5688
+ tabIndex: -1,
5689
+ role: "button",
5690
+ "aria-label": title,
5691
+ "aria-expanded": openAccordion,
5692
+ "aria-controls": contentContainerId
5666
5693
  }, /*#__PURE__*/React__default.createElement("h4", null, /*#__PURE__*/React__default.createElement("a", {
5667
5694
  className: "accordion-title"
5668
5695
  }, title)), children && /*#__PURE__*/React__default.createElement(Icon, {
5669
5696
  iconName: iconName
5670
- })), /*#__PURE__*/React__default.createElement(Standfirst, null), /*#__PURE__*/React__default.createElement(ContentContainer, {
5697
+ })), visibleStandfirst && /*#__PURE__*/React__default.createElement(Standfirst, null), /*#__PURE__*/React__default.createElement(ContentContainer, {
5671
5698
  "data-testid": "richcontainer",
5672
5699
  ref: content,
5673
5700
  style: {
5674
5701
  maxHeight: "" + textHeight
5675
- }
5702
+ },
5703
+ id: contentContainerId,
5704
+ "aria-live": "polite"
5676
5705
  }, /*#__PURE__*/React__default.createElement(ChildrenContainer, {
5677
5706
  style: childrenVisibility
5678
5707
  }, children)), showLine && /*#__PURE__*/React__default.createElement(LineContainer, null));
@@ -6091,9 +6120,10 @@ var AddressWrapperMobile = /*#__PURE__*/styled__default.div(_templateObject4$j |
6091
6120
  var DetailsWrapper = /*#__PURE__*/styled__default.div(_templateObject5$d || (_templateObject5$d = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n\n @media ", " {\n flex-direction: column;\n margin: 4px 0;\n }\n\n a {\n font-size: var(--font-size-body-1);\n font-family: var(--font-family-body);\n font-feature-settings: var(--font-feature-settings-body);\n font-weight: var(--font-weight-body-1);\n letter-spacing: var(--letter-spacing-body-1);\n line-height: var(--line-height-body-1);\n text-transform: var(--text-transform-body);\n color: var(--base-color-black);\n text-decoration: underline;\n\n &:before {\n display: inline-block;\n content: '';\n background-color: var(--base-color-black);\n width: 1px;\n height: 18px;\n margin: 0 8px -4px;\n\n @media ", " {\n display: none;\n }\n }\n\n &:first-child:before {\n display: none;\n }\n }\n"])), devices.mobile, devices.mobile);
6092
6121
 
6093
6122
  var divideAddressString = function divideAddressString(address) {
6094
- return address.split(',').map(function (chunk) {
6123
+ return address.split(',').map(function (chunk, i) {
6095
6124
  return /*#__PURE__*/React__default.createElement(BodyText, {
6096
- level: 1
6125
+ level: 1,
6126
+ key: i
6097
6127
  }, chunk.trim());
6098
6128
  });
6099
6129
  };
@@ -6768,10 +6798,10 @@ var isIOS = function isIOS() {
6768
6798
  return ['iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod'].includes(navigator.platform) || // iPad on iOS 13 detection
6769
6799
  navigator.userAgent.includes('Mac') && 'ontouchend' in document;
6770
6800
  } catch (e) {
6771
- console.warn('Error checking if device is iOS.');
6801
+ console.warn('Error checking if device is iOS.', e);
6772
6802
  return false;
6773
6803
  }
6774
- }; // React hook version of isIOS
6804
+ }; // React hook version of isIOS (for server side rendering)
6775
6805
 
6776
6806
 
6777
6807
  var useIOS = function useIOS() {
@@ -6788,13 +6818,14 @@ var useIOS = function useIOS() {
6788
6818
 
6789
6819
  var isMobile = function isMobile() {
6790
6820
  try {
6821
+ console.warn('Do not use this on server side rendering, it may throw an error.');
6791
6822
  if (typeof window === undefined) return false;
6792
6823
  return window.innerWidth < breakpoints.sm;
6793
6824
  } catch (e) {
6794
- console.warn('Error checking if device is mobile.');
6825
+ console.warn('Error checking if device is mobile.', e);
6795
6826
  return false;
6796
6827
  }
6797
- }; // React hook version of isMobile
6828
+ }; // React hook version of isMobile (for server side rendering)
6798
6829
 
6799
6830
  var useMobile = function useMobile() {
6800
6831
  var _useState2 = React.useState(false),
@@ -6892,8 +6923,6 @@ var CompactHeaderImage = function CompactHeaderImage(_ref2) {
6892
6923
  var CompactHeaderVideo = function CompactHeaderVideo(_ref3) {
6893
6924
  var video = _ref3.video,
6894
6925
  poster = _ref3.poster;
6895
- // Renders fallback image if no video supplied
6896
- console.warn('video', video);
6897
6926
 
6898
6927
  if (!video.desktop && !video.mobile) {
6899
6928
  return /*#__PURE__*/React__default.createElement(CompactHeaderImage, Object.assign({}, poster));