@royaloperahouse/chord 0.7.3 → 0.7.7

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,5 +1,17 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## [0.7.7]
4
+ - Tabs: close dropdown when it is clicked twice
5
+
6
+ ## [0.7.6]
7
+ - Add new initOpen prop to Accordion component
8
+
9
+ ## [0.7.5]
10
+ - Fix Styling in PeopleListing on Desktop
11
+
12
+ ## [0.7.4]
13
+ - Fix git README
14
+
3
15
  ## [0.7.3]
4
16
  - Fix Styling in PeopleListing on Mobile
5
17
 
@@ -3583,8 +3583,10 @@ var Tabs = function Tabs(_ref) {
3583
3583
  };
3584
3584
 
3585
3585
  var onDropdownClick = function onDropdownClick(i, link) {
3586
- var nextActive = i === activeDropdown ? -1 : i;
3586
+ var isActiveDropdownClicked = i === activeDropdown;
3587
+ var nextActive = isActiveDropdownClicked ? -1 : i;
3587
3588
  setActiveDropdown(nextActive);
3589
+ if (isActiveDropdownClicked) setHoverOverDropdown(-1);
3588
3590
  if (onChange && link) onChange(link);
3589
3591
  };
3590
3592
 
@@ -4596,9 +4598,11 @@ var Accordion = function Accordion(_ref) {
4596
4598
  title = _ref$title === void 0 ? '' : _ref$title,
4597
4599
  _ref$showLine = _ref.showLine,
4598
4600
  showLine = _ref$showLine === void 0 ? true : _ref$showLine,
4599
- children = _ref.children;
4601
+ children = _ref.children,
4602
+ _ref$initOpen = _ref.initOpen,
4603
+ initOpen = _ref$initOpen === void 0 ? false : _ref$initOpen;
4600
4604
 
4601
- var _useState = React.useState(false),
4605
+ var _useState = React.useState(initOpen),
4602
4606
  openAccordion = _useState[0],
4603
4607
  setOpenAccordion = _useState[1];
4604
4608
 
@@ -4606,11 +4610,16 @@ var Accordion = function Accordion(_ref) {
4606
4610
  textHeight = _useState2[0],
4607
4611
  setTextHeight = _useState2[1];
4608
4612
 
4609
- var _useState3 = React.useState('Expand'),
4613
+ var _useState3 = React.useState(initOpen ? 'Detract' : 'Expand'),
4610
4614
  iconName = _useState3[0],
4611
4615
  setIconName = _useState3[1];
4612
4616
 
4613
4617
  var content = React.useRef(null);
4618
+ React.useEffect(function () {
4619
+ if (content != null && content.current && initOpen) {
4620
+ setTextHeight(content.current.scrollHeight + "px");
4621
+ }
4622
+ }, [content, initOpen]);
4614
4623
 
4615
4624
  var toggleAccordion = function toggleAccordion() {
4616
4625
  setOpenAccordion(!openAccordion);
@@ -5066,7 +5075,7 @@ var PageHeadingStream = function PageHeadingStream(_ref) {
5066
5075
  };
5067
5076
 
5068
5077
  var _templateObject$J, _templateObject2$s, _templateObject3$l;
5069
- var PeopleListingGrid = /*#__PURE__*/styled__default(Grid)(_templateObject$J || (_templateObject$J = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n gap: var(--line-height-people-listing-gap) var(--grid-column-gap);\n\n @media ", " {\n p {\n margin: 0;\n }\n }\n"])), devices.mobile);
5078
+ var PeopleListingGrid = /*#__PURE__*/styled__default(Grid)(_templateObject$J || (_templateObject$J = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n gap: var(--line-height-people-listing-gap) var(--grid-column-gap);\n\n p {\n margin: 0;\n }\n"])));
5070
5079
  var RoleWrapper = /*#__PURE__*/styled__default.div(_templateObject2$s || (_templateObject2$s = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: var(--base-color-darkgrey);\n overflow-wrap: break-word;\n"])));
5071
5080
  var PersonLink = /*#__PURE__*/styled__default.a(_templateObject3$l || (_templateObject3$l = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: var(--base-color-black);\n\n :hover {\n color: var(--base-color-primary);\n :after {\n color: var(--base-color-black);\n }\n }\n\n :visited {\n color: var(--base-color-black);\n }\n"])));
5072
5081