@royaloperahouse/harmonic 0.7.1-c → 0.7.1-e

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.
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { IContentSummaryProps } from '../../../types/editorial';
3
- declare const ContentSummary: ({ title, subtitle, bodyText, link, image, largeTitle, showImage, truncate, fullyClickable, baseSemanticLevel, }: IContentSummaryProps) => React.JSX.Element;
3
+ declare const ContentSummary: ({ title, subtitle, bodyText, link, image, largeTitle, showImage, truncate, fullyClickable, headerSemanticLevel, className, }: IContentSummaryProps) => React.JSX.Element;
4
4
  export default ContentSummary;
@@ -7,7 +7,7 @@ interface ContentSummaryProps {
7
7
  interface Clickable {
8
8
  clickable?: boolean;
9
9
  }
10
- export declare const BodyTextRelative: import("styled-components").StyledComponent<({ level, children, tag }: import("../../../types/typography").IBodyTextProps) => import("react").JSX.Element, any, {}, never>;
10
+ export declare const BodyTextRelative: import("styled-components").StyledComponent<({ children, size, color, className, ...props }: import("../../../types/typography").IGenericTypographyProps<HTMLParagraphElement>) => import("react").JSX.Element, any, {}, never>;
11
11
  export declare const ContentSummaryWrapper: import("styled-components").StyledComponent<"article", any, Clickable, never>;
12
12
  export declare const ContentSummaryImageWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
13
13
  export declare const ContentSummaryTextWrapper: import("styled-components").StyledComponent<"div", any, ContentSummaryProps, never>;
@@ -4,6 +4,6 @@ export declare const PageNumberWrapper: import("styled-components").StyledCompon
4
4
  export declare const LastPageItem: import("styled-components").StyledComponent<"li", any, {}, never>;
5
5
  export declare const PreviousPageItem: import("styled-components").StyledComponent<"li", any, {}, never>;
6
6
  export declare const TextLinkPagination: import("styled-components").StyledComponent<({ children, size, color, className, ...props }: import("../../../types/typography").IGenericTypographyProps<HTMLParagraphElement>) => import("react").JSX.Element, any, {
7
- active?: string | undefined;
7
+ active?: boolean | undefined;
8
8
  }, never>;
9
9
  export declare const PageNav: import("styled-components").StyledComponent<"a", any, {}, never>;
@@ -2703,15 +2703,16 @@ var Button = function Button(_ref) {
2703
2703
  onClick = _ref.onClick,
2704
2704
  rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
2705
2705
  var truncatedString = children.substring(0, 30);
2706
- var handleClick = function handleClick(e) {
2707
- if (href) return;
2708
- e.preventDefault();
2706
+ var handleClick = React.useCallback(function (e) {
2707
+ if (!href) e.preventDefault();
2709
2708
  onClick == null || onClick(e);
2710
- };
2711
- return /*#__PURE__*/React__default.createElement(ButtonWrapper, Object.assign({}, rest, {
2709
+ }, [href, onClick]);
2710
+ return /*#__PURE__*/React__default.createElement(ButtonWrapper, Object.assign({
2711
+ role: href ? undefined : 'button',
2712
+ tabIndex: href ? undefined : 0
2713
+ }, rest, {
2712
2714
  href: href != null ? href : '#',
2713
2715
  onClick: handleClick,
2714
- color: color,
2715
2716
  iconName: iconName,
2716
2717
  className: className
2717
2718
  }), iconName ? (/*#__PURE__*/React__default.createElement(ButtonIconWrapper, {
@@ -8634,21 +8635,20 @@ var ContactCard = function ContactCard(_ref) {
8634
8635
  };
8635
8636
 
8636
8637
  var _templateObject$X, _templateObject2$I, _templateObject3$v, _templateObject4$q, _templateObject5$k, _templateObject6$g, _templateObject7$b;
8637
- var BodyTextRelative = /*#__PURE__*/styled__default(BodyText)(_templateObject$X || (_templateObject$X = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n"])));
8638
+ var BodyTextRelative = /*#__PURE__*/styled__default(BodyCopyHarmonic)(_templateObject$X || (_templateObject$X = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n"])));
8638
8639
  var ContentSummaryWrapper = /*#__PURE__*/styled__default.article(_templateObject2$I || (_templateObject2$I = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n position: relative;\n justify-items: start;\n align-items: center;\n margin: 20px 0;\n gap: 24px;\n cursor: ", ";\n\n @media ", " {\n display: flex;\n flex-direction: column;\n gap: 24px;\n }\n"])), function (props) {
8639
8640
  return props.clickable ? 'pointer' : 'default';
8640
8641
  }, devices.mobile);
8641
8642
  var ContentSummaryImageWrapper = /*#__PURE__*/styled__default.div(_templateObject3$v || (_templateObject3$v = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 0 0 33.3%;\n"])));
8642
- var ContentSummaryTextWrapper = /*#__PURE__*/styled__default.div(_templateObject4$q || (_templateObject4$q = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n grid-column: ", ";\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n gap: 22px;\n\n & > * {\n margin-block-start: 0;\n margin-block-end: 0;\n }\n\n @media ", " {\n margin: 0 20px;\n gap: 12px;\n }\n\n & .content-summary-text-link {\n height: unset;\n }\n"])), function (props) {
8643
+ var ContentSummaryTextWrapper = /*#__PURE__*/styled__default.div(_templateObject4$q || (_templateObject4$q = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n grid-column: ", ";\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n gap: 20px;\n\n & * {\n margin-block-start: 0;\n margin-block-end: 0;\n }\n\n @media ", " {\n margin: 0 20px;\n }\n\n & .content-summary-text-link {\n height: unset;\n }\n"])), function (props) {
8643
8644
  return props.showImage ? 2 : '1 / span 4';
8644
8645
  }, devices.mobile);
8645
- var ContentSummaryTitleWrapper = /*#__PURE__*/styled__default.div(_templateObject5$k || (_templateObject5$k = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n & > * {\n margin: 0;\n }\n\n @media ", " {\n & > * {\n font-size: var(--font-size-header-5);\n font-weight: var(--font-weight-header-5);\n }\n }\n"])), devices.mobile);
8646
+ var ContentSummaryTitleWrapper = /*#__PURE__*/styled__default.div(_templateObject5$k || (_templateObject5$k = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
8646
8647
  var BodyTextLimit = /*#__PURE__*/styled__default.div(_templateObject6$g || (_templateObject6$g = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: block;\n position: relative;\n"])));
8647
8648
  var ContentSummaryBodyTextWrapper = /*#__PURE__*/styled__default.div(_templateObject7$b || (_templateObject7$b = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n & p:not(:last-child):after {\n content: '\\A\\A';\n white-space: pre;\n }\n\n ", "\n"], ["\n & p:not(:last-child):after {\n content: '\\\\A\\\\A';\n white-space: pre;\n }\n\n ", "\n"])), function (props) {
8648
8649
  return !!props.truncate && "\n overflow: hidden;\n position: relative;\n display: -webkit-box;\n -webkit-line-clamp: " + props.truncate + ";\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n min-height: 1em;\n max-height: 3em;\n ";
8649
8650
  });
8650
8651
 
8651
- var MAX_HEADER_LEVEL = 6;
8652
8652
  var clickHandler = function clickHandler(link) {
8653
8653
  if (link != null && link.href && document) {
8654
8654
  document.location.href = link.href;
@@ -8668,9 +8668,11 @@ var ContentSummary = function ContentSummary(_ref) {
8668
8668
  truncate = _ref$truncate === void 0 ? 0 : _ref$truncate,
8669
8669
  _ref$fullyClickable = _ref.fullyClickable,
8670
8670
  fullyClickable = _ref$fullyClickable === void 0 ? true : _ref$fullyClickable,
8671
- _ref$baseSemanticLeve = _ref.baseSemanticLevel,
8672
- baseSemanticLevel = _ref$baseSemanticLeve === void 0 ? 3 : _ref$baseSemanticLeve;
8671
+ _ref$headerSemanticLe = _ref.headerSemanticLevel,
8672
+ headerSemanticLevel = _ref$headerSemanticLe === void 0 ? 'h3' : _ref$headerSemanticLe,
8673
+ className = _ref.className;
8673
8674
  return /*#__PURE__*/React__default.createElement(ContentSummaryWrapper, {
8675
+ className: className,
8674
8676
  onClick: function onClick() {
8675
8677
  if (fullyClickable) {
8676
8678
  clickHandler(link);
@@ -8694,17 +8696,16 @@ var ContentSummary = function ContentSummary(_ref) {
8694
8696
  showImage: showImage
8695
8697
  }, title && (/*#__PURE__*/React__default.createElement(ContentSummaryTitleWrapper, {
8696
8698
  "data-testid": largeTitle ? 'large-title' : 'default-title'
8697
- }, largeTitle ? (/*#__PURE__*/React__default.createElement(Header, {
8698
- level: 5,
8699
- semanticLevel: baseSemanticLevel
8700
- }, title)) : (/*#__PURE__*/React__default.createElement(Subtitle, {
8701
- level: 1,
8702
- semanticLevel: baseSemanticLevel
8703
- }, title)))), subtitle && (/*#__PURE__*/React__default.createElement(Subtitle, {
8704
- level: 2,
8705
- semanticLevel: title ? Math.min(MAX_HEADER_LEVEL, baseSemanticLevel + 1) : baseSemanticLevel
8699
+ }, largeTitle ? (/*#__PURE__*/React__default.createElement(HarmonicHeader, {
8700
+ size: "large",
8701
+ hierarchy: headerSemanticLevel
8702
+ }, title)) : (/*#__PURE__*/React__default.createElement(HarmonicHeader, {
8703
+ size: "medium",
8704
+ hierarchy: headerSemanticLevel
8705
+ }, title)))), subtitle && (/*#__PURE__*/React__default.createElement(HarmonicSubtitle, {
8706
+ size: "large"
8706
8707
  }, subtitle)), bodyText && (/*#__PURE__*/React__default.createElement(BodyTextRelative, {
8707
- level: 1
8708
+ size: "large"
8708
8709
  }, /*#__PURE__*/React__default.createElement(BodyTextLimit, null, /*#__PURE__*/React__default.createElement(ContentSummaryBodyTextWrapper, {
8709
8710
  truncate: truncate,
8710
8711
  dangerouslySetInnerHTML: {
@@ -9692,9 +9693,12 @@ var PaginationLink = /*#__PURE__*/styled__default.a(_templateObject2$R || (_temp
9692
9693
  var PageNumberWrapper = /*#__PURE__*/styled__default.ol(_templateObject3$E || (_templateObject3$E = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n min-width: fit-content;\n align-items: center;\n justify-content: center;\n margin-top: 40px;\n margin-bottom: 40px;\n flex-wrap: nowrap;\n flex-direction: row;\n list-style: none;\n padding: 0;\n max-width: fit-content;\n margin: auto;\n li {\n margin-left: 24px;\n color: var(--color-base-black);\n display: flex;\n align-items: center;\n }\n li:first-child {\n margin-left: 0px;\n }\n"])));
9693
9694
  var LastPageItem = /*#__PURE__*/styled__default.li(_templateObject4$x || (_templateObject4$x = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n && {\n margin-left: 12px;\n }\n"])));
9694
9695
  var PreviousPageItem = /*#__PURE__*/styled__default.li(_templateObject5$r || (_templateObject5$r = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n && {\n margin-left: 12px;\n }\n"])));
9695
- var TextLinkPagination = /*#__PURE__*/styled__default(BodyCopyHarmonic)(_templateObject6$l || (_templateObject6$l = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: inherit;\n margin: 0;\n border-bottom: 1px solid transparent;\n line-height: var(--base-line-height);\n :hover {\n cursor: pointer;\n color: var(--color-primary-red);\n border-bottom: 1px solid var(--color-primary-red);\n svg > path {\n fill: var(--color-base-black);\n }\n }\n /* active state - string used because react returns error for bool */\n ", "\n"])), function (_ref) {
9696
+ var TextLinkPagination = /*#__PURE__*/styled__default(BodyCopyHarmonic)(_templateObject6$l || (_templateObject6$l = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n && {\n color: ", ";\n border-bottom: ", ";\n }\n\n :hover {\n cursor: pointer;\n color: var(--color-primary-red);\n border-bottom: 1px solid var(--color-primary-red);\n svg > path {\n fill: var(--color-base-black);\n }\n }\n"])), function (_ref) {
9696
9697
  var active = _ref.active;
9697
- return active === 'true' && " \n border-bottom: 1px solid var(--color-primary-red);\n color: var(--color-primary-red);\n ";
9698
+ return active ? "var(--color-primary-red)" : 'inherit';
9699
+ }, function (_ref2) {
9700
+ var active = _ref2.active;
9701
+ return "1px solid " + (active ? 'var(--color-primary-red)' : 'transparent');
9698
9702
  });
9699
9703
  var PageNav = /*#__PURE__*/styled__default.a(_templateObject7$g || (_templateObject7$g = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: inline-flex;\n width: 25px;\n align-items: center;\n justify-content: center;\n margin-left: 0;\n span {\n height: 1.5em;\n svg > path {\n fill: var(--color-base-black);\n }\n }\n"])));
9700
9704
 
@@ -9753,7 +9757,7 @@ var Pagination = function Pagination(_ref) {
9753
9757
  "data-testid": "page-number"
9754
9758
  }, /*#__PURE__*/React__default.createElement(TextLinkPagination, {
9755
9759
  size: "large",
9756
- active: "" + (page === currentPage)
9760
+ active: page === currentPage
9757
9761
  }, page.toString())));
9758
9762
  }), currentPage < pageCount && (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("li", {
9759
9763
  key: "next-page",