@royaloperahouse/harmonic 0.17.0-l → 0.17.1-a

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.
@@ -5871,6 +5871,7 @@ var PrintHideWrapper = /*#__PURE__*/styled.div(_templateObject7$5 || (_templateO
5871
5871
 
5872
5872
  /* eslint-disable react/no-unstable-nested-components */
5873
5873
  var Accordion = function Accordion(_ref) {
5874
+ var _expandedStateIcon$ic, _collapsedStateIcon$i;
5874
5875
  var _ref$title = _ref.title,
5875
5876
  title = _ref$title === void 0 ? '' : _ref$title,
5876
5877
  _ref$showLine = _ref.showLine,
@@ -5878,16 +5879,26 @@ var Accordion = function Accordion(_ref) {
5878
5879
  children = _ref.children,
5879
5880
  _ref$initOpen = _ref.initOpen,
5880
5881
  initOpen = _ref$initOpen === void 0 ? false : _ref$initOpen,
5881
- className = _ref.className;
5882
+ className = _ref.className,
5883
+ expandedStateIcon = _ref.expandedStateIcon,
5884
+ collapsedStateIcon = _ref.collapsedStateIcon;
5882
5885
  var _useState = useState(initOpen),
5883
5886
  openAccordion = _useState[0],
5884
5887
  setOpenAccordion = _useState[1];
5885
5888
  var _useState2 = useState('0px'),
5886
5889
  textHeight = _useState2[0],
5887
5890
  setTextHeight = _useState2[1];
5888
- var _useState3 = useState(initOpen ? 'Detract' : 'Expand'),
5889
- iconName = _useState3[0],
5890
- setIconName = _useState3[1];
5891
+ var expandedStateIconData = {
5892
+ iconName: (_expandedStateIcon$ic = expandedStateIcon == null ? void 0 : expandedStateIcon.iconName) != null ? _expandedStateIcon$ic : 'Detract',
5893
+ direction: expandedStateIcon == null ? void 0 : expandedStateIcon.direction
5894
+ };
5895
+ var collapsedStateIconData = {
5896
+ iconName: (_collapsedStateIcon$i = collapsedStateIcon == null ? void 0 : collapsedStateIcon.iconName) != null ? _collapsedStateIcon$i : 'Expand',
5897
+ direction: collapsedStateIcon == null ? void 0 : collapsedStateIcon.direction
5898
+ };
5899
+ var _useState3 = useState(initOpen ? expandedStateIconData : collapsedStateIconData),
5900
+ icon = _useState3[0],
5901
+ setIcon = _useState3[1];
5891
5902
  // Contents children visibility is set to prevent it from being keyboard tabbable when the accordion is closed
5892
5903
  var _useState4 = useState(initOpen),
5893
5904
  childrenVisibility = _useState4[0],
@@ -5911,7 +5922,7 @@ var Accordion = function Accordion(_ref) {
5911
5922
  var toggleAccordion = function toggleAccordion() {
5912
5923
  if (React__default.Children.count(children) === 0) return;
5913
5924
  if (openAccordion) {
5914
- setIconName('Expand');
5925
+ setIcon(collapsedStateIconData);
5915
5926
  setOpenAccordion(false);
5916
5927
  setTextHeight('0px');
5917
5928
  window.setTimeout(function () {
@@ -5920,7 +5931,7 @@ var Accordion = function Accordion(_ref) {
5920
5931
  } else {
5921
5932
  setChildrenVisibility(true);
5922
5933
  setOpenAccordion(true);
5923
- setIconName('Detract');
5934
+ setIcon(expandedStateIconData);
5924
5935
  }
5925
5936
  };
5926
5937
  var keyDown = function keyDown(e) {
@@ -5942,9 +5953,7 @@ var Accordion = function Accordion(_ref) {
5942
5953
  "aria-expanded": openAccordion,
5943
5954
  "aria-controls": contentContainerId,
5944
5955
  hasChildren: !!children
5945
- }, /*#__PURE__*/React__default.createElement(TitleText, null, title), children && (/*#__PURE__*/React__default.createElement(PrintHideWrapper, null, /*#__PURE__*/React__default.createElement(Icon, {
5946
- iconName: iconName
5947
- })))), /*#__PURE__*/React__default.createElement(ContentContainer, {
5956
+ }, /*#__PURE__*/React__default.createElement(TitleText, null, title), children && (/*#__PURE__*/React__default.createElement(PrintHideWrapper, null, /*#__PURE__*/React__default.createElement(Icon, Object.assign({}, icon))))), /*#__PURE__*/React__default.createElement(ContentContainer, {
5948
5957
  "data-testid": "richcontainer",
5949
5958
  ref: content,
5950
5959
  textHeight: textHeight,
@@ -5973,7 +5982,9 @@ var Accordions = function Accordions(_ref) {
5973
5982
  return /*#__PURE__*/React__default.createElement(Accordion, {
5974
5983
  key: accordion.title + "-" + index,
5975
5984
  title: accordion.title,
5976
- showLine: isLastAccordion(index)
5985
+ showLine: isLastAccordion(index),
5986
+ expandedStateIcon: accordion.expandedStateIcon,
5987
+ collapsedStateIcon: accordion.collapsedStateIcon
5977
5988
  }, accordion.children);
5978
5989
  }));
5979
5990
  };
@@ -8535,7 +8546,7 @@ var _excluded$l = ["text"],
8535
8546
  _excluded3$1 = ["text"];
8536
8547
  var _buttonTypeToButton$1;
8537
8548
  var LENGTH_TEXT$1 = 28;
8538
- var LENGTH_TEXT_PARAGRAPH = 185;
8549
+ var LENGTH_TEXT_PARAGRAPH = 130;
8539
8550
  var buttonTypeToButton$1 = (_buttonTypeToButton$1 = {}, _buttonTypeToButton$1[ButtonType.Primary] = PrimaryButton, _buttonTypeToButton$1[ButtonType.Secondary] = SecondaryButton, _buttonTypeToButton$1[ButtonType.Tertiary] = TertiaryButton, _buttonTypeToButton$1);
8540
8551
  var PromoWithTags = function PromoWithTags(_ref) {
8541
8552
  var _ref$imagePosition = _ref.imagePosition,