@quintype/arrow 3.15.1-fallback-support.1 → 3.15.1-perf.1

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.
Files changed (167) hide show
  1. package/atoms/Author/index.js +2250 -0
  2. package/{Author → atoms/Author}/styles.arrow.css +0 -0
  3. package/atoms/AuthorWithTime/index.js +2954 -0
  4. package/{AuthorWithTime → atoms/AuthorWithTime}/styles.arrow.css +0 -0
  5. package/atoms/CollectionName/index.js +2334 -0
  6. package/{CollectionName → atoms/CollectionName}/styles.arrow.css +0 -0
  7. package/atoms/ExtendedLoadMore/index-2d713010.js +166 -0
  8. package/atoms/ExtendedLoadMore/index-4191a84c.js +240 -0
  9. package/atoms/ExtendedLoadMore/index-5a7900ba.js +181 -0
  10. package/atoms/ExtendedLoadMore/index-6cb56d1a.js +350 -0
  11. package/atoms/ExtendedLoadMore/index-6daa674c.js +282 -0
  12. package/atoms/ExtendedLoadMore/index-6f8c780e.js +243 -0
  13. package/atoms/ExtendedLoadMore/index-7eb05b3d.js +199 -0
  14. package/atoms/ExtendedLoadMore/index-8345922c.js +175 -0
  15. package/atoms/ExtendedLoadMore/index-99af722e.js +175 -0
  16. package/atoms/ExtendedLoadMore/index-aa8b8ab8.js +990 -0
  17. package/atoms/ExtendedLoadMore/index-c8f346d0.js +223 -0
  18. package/atoms/ExtendedLoadMore/index-e39b3ca8.js +3023 -0
  19. package/atoms/ExtendedLoadMore/index-f6e578e3.js +86 -0
  20. package/atoms/ExtendedLoadMore/index.js +5 -0
  21. package/atoms/ExtendedLoadMore/styles.arrow.css +1 -0
  22. package/atoms/Headline/index.js +2459 -0
  23. package/{Headline → atoms/Headline}/styles.arrow.css +0 -0
  24. package/atoms/HeroImage/index.js +2475 -0
  25. package/{HeroImage → atoms/HeroImage}/styles.arrow.css +0 -0
  26. package/atoms/LoadmoreButton/index.js +2268 -0
  27. package/{LoadmoreButton → atoms/LoadmoreButton}/styles.arrow.css +0 -0
  28. package/atoms/ScrollSnap/index.js +2531 -0
  29. package/{ScrollSnap → atoms/ScrollSnap}/styles.arrow.css +0 -0
  30. package/atoms/SectionTag/index.js +2220 -0
  31. package/{SectionTag → atoms/SectionTag}/styles.arrow.css +0 -0
  32. package/atoms/Subheadline/index.js +2200 -0
  33. package/{Subheadline → atoms/Subheadline}/styles.arrow.css +0 -0
  34. package/atoms/TimeStamp/index.js +2661 -0
  35. package/{TimeStamp → atoms/TimeStamp}/styles.arrow.css +0 -0
  36. package/molecules/KeyEvents/index.js +2968 -0
  37. package/{KeyEvents → molecules/KeyEvents}/styles.arrow.css +0 -0
  38. package/molecules/PageIntroductionCard/index.js +2676 -0
  39. package/{PageIntroductionCard → molecules/PageIntroductionCard}/styles.arrow.css +0 -0
  40. package/molecules/SocialShareTemplate/index.js +3093 -0
  41. package/{SocialShareTemplate → molecules/SocialShareTemplate}/styles.arrow.css +0 -0
  42. package/molecules/StoryCard/index.js +3938 -0
  43. package/{StoryCard → molecules/StoryCard}/styles.arrow.css +0 -0
  44. package/molecules/StoryElementCard/index.js +5832 -0
  45. package/{StoryElementCard → molecules/StoryElementCard}/styles.arrow.css +0 -0
  46. package/molecules/StorycardContent/index.js +3416 -0
  47. package/{StorycardContent → molecules/StorycardContent}/styles.arrow.css +0 -0
  48. package/package.json +1 -1
  49. package/rows/AlternateCollectionFilter/index.js +4744 -0
  50. package/{AlternateCollectionFilter → rows/AlternateCollectionFilter}/styles.arrow.css +0 -0
  51. package/rows/AsideCollection/index.js +4690 -0
  52. package/{AsideCollection → rows/AsideCollection}/styles.arrow.css +0 -0
  53. package/rows/AstrologyCollection/index.js +4661 -0
  54. package/{AstrologyCollection → rows/AstrologyCollection}/styles.arrow.css +0 -0
  55. package/rows/AuthorIntroductionCard/index.js +3520 -0
  56. package/{AuthorIntroductionCard → rows/AuthorIntroductionCard}/styles.arrow.css +0 -0
  57. package/rows/AuthorsList/index.js +3715 -0
  58. package/{AuthorsList → rows/AuthorsList}/styles.arrow.css +0 -0
  59. package/rows/CollectionFilter/index.js +4834 -0
  60. package/{CollectionFilter → rows/CollectionFilter}/styles.arrow.css +0 -0
  61. package/rows/ElevenStories/index.js +4638 -0
  62. package/{ElevenStories → rows/ElevenStories}/styles.arrow.css +0 -0
  63. package/rows/FourColFiveStories/index.js +4359 -0
  64. package/{FourColFiveStories → rows/FourColFiveStories}/styles.arrow.css +0 -0
  65. package/rows/FourColGrid/index.js +4584 -0
  66. package/{FourColGrid → rows/FourColGrid}/styles.arrow.css +0 -0
  67. package/rows/FourColPortraitStories/index.js +4617 -0
  68. package/{FourColPortraitStories → rows/FourColPortraitStories}/styles.arrow.css +0 -0
  69. package/rows/FourColSixteenStories/index.js +4375 -0
  70. package/{FourColSixteenStories → rows/FourColSixteenStories}/styles.arrow.css +0 -0
  71. package/rows/FourColTwelveStories/index.js +4335 -0
  72. package/{FourColTwelveStories → rows/FourColTwelveStories}/styles.arrow.css +0 -0
  73. package/rows/FourStorySlider/index.js +4743 -0
  74. package/{FourStorySlider → rows/FourStorySlider}/styles.arrow.css +0 -0
  75. package/rows/FourStorySliderPortrait/index.js +4746 -0
  76. package/{FourStorySliderPortrait → rows/FourStorySliderPortrait}/styles.arrow.css +1 -1
  77. package/rows/FourTabbedBigStorySlider/index.js +4505 -0
  78. package/{FourTabbedBigStorySlider → rows/FourTabbedBigStorySlider}/styles.arrow.css +0 -0
  79. package/rows/FullScreenSlider/index.js +4661 -0
  80. package/{FullScreenSlider → rows/FullScreenSlider}/styles.arrow.css +0 -0
  81. package/rows/HalfScreenSlider/index.js +4514 -0
  82. package/{HalfScreenSlider → rows/HalfScreenSlider}/styles.arrow.css +0 -0
  83. package/rows/ListComponent/index.js +4462 -0
  84. package/{ListComponent → rows/ListComponent}/styles.arrow.css +0 -0
  85. package/rows/Listicles/index.js +3131 -0
  86. package/{Listicles → rows/Listicles}/styles.arrow.css +0 -0
  87. package/rows/MagazineEditions/index.js +3142 -0
  88. package/{MagazineEditions → rows/MagazineEditions}/styles.arrow.css +0 -0
  89. package/rows/MagazineHeaderCard/index.js +3136 -0
  90. package/{MagazineHeaderCard → rows/MagazineHeaderCard}/styles.arrow.css +0 -0
  91. package/rows/MagazineWidget/index.js +4514 -0
  92. package/{MagazineWidget → rows/MagazineWidget}/styles.arrow.css +0 -0
  93. package/rows/OneColStoryList/index.js +4670 -0
  94. package/{OneColStoryList → rows/OneColStoryList}/styles.arrow.css +0 -0
  95. package/rows/OpinionCollection/index.js +4037 -0
  96. package/{OpinionCollection → rows/OpinionCollection}/styles.arrow.css +0 -0
  97. package/rows/SixColSixStories/index.js +4515 -0
  98. package/{SixColSixStories → rows/SixColSixStories}/styles.arrow.css +0 -0
  99. package/rows/StoryCollection/index.js +4690 -0
  100. package/{StoryCollection → rows/StoryCollection}/styles.arrow.css +0 -0
  101. package/rows/TagIntroductionCard/index.js +1901 -0
  102. package/{TagIntroductionCard → rows/TagIntroductionCard}/styles.arrow.css +0 -0
  103. package/rows/ThreeColFlexStories/index.js +4575 -0
  104. package/{ThreeColFlexStories → rows/ThreeColFlexStories}/styles.arrow.css +0 -0
  105. package/rows/ThreeColFourteenStories/index.js +4283 -0
  106. package/{ThreeColFourteenStories → rows/ThreeColFourteenStories}/styles.arrow.css +0 -0
  107. package/rows/ThreeColGrid/index.js +4605 -0
  108. package/{ThreeColGrid → rows/ThreeColGrid}/styles.arrow.css +0 -0
  109. package/rows/ThreeColSevenStory/index.js +4502 -0
  110. package/{ThreeColSevenStory → rows/ThreeColSevenStory}/styles.arrow.css +0 -0
  111. package/rows/ThreeColSixStories/index.js +4485 -0
  112. package/{ThreeColSixStories → rows/ThreeColSixStories}/styles.arrow.css +0 -0
  113. package/rows/ThreeColTwelveStories/index.js +4380 -0
  114. package/{ThreeColTwelveStories → rows/ThreeColTwelveStories}/styles.arrow.css +0 -0
  115. package/rows/TwoColFourStories/index.js +4463 -0
  116. package/{TwoColFourStories → rows/TwoColFourStories}/styles.arrow.css +0 -0
  117. package/rows/TwoColFourStoryHighlight/index.js +4456 -0
  118. package/{TwoColFourStoryHighlight → rows/TwoColFourStoryHighlight}/styles.arrow.css +0 -0
  119. package/rows/TwoColSevenStories/index.js +4490 -0
  120. package/{TwoColSevenStories → rows/TwoColSevenStories}/styles.arrow.css +0 -0
  121. package/rows/TwoColSixStories/index.js +4489 -0
  122. package/{TwoColSixStories → rows/TwoColSixStories}/styles.arrow.css +0 -0
  123. package/rows/TwoColTenStoriesSidebar/index.js +4549 -0
  124. package/{TwoColTenStoriesSidebar → rows/TwoColTenStoriesSidebar}/styles.arrow.css +0 -0
  125. package/rows/TwoColThreeStories/index.js +4436 -0
  126. package/{TwoColThreeStories → rows/TwoColThreeStories}/styles.arrow.css +0 -0
  127. package/story-elements/AlsoRead/index.js +2457 -0
  128. package/{AlsoRead → story-elements/AlsoRead}/styles.arrow.css +0 -0
  129. package/story-elements/Attachment/index.js +2013 -0
  130. package/{Attachment → story-elements/Attachment}/styles.arrow.css +0 -0
  131. package/story-elements/BigFact/index.js +1983 -0
  132. package/{BigFact → story-elements/BigFact}/styles.arrow.css +0 -0
  133. package/story-elements/BlockQuote/index.js +2431 -0
  134. package/{BlockQuote → story-elements/BlockQuote}/styles.arrow.css +0 -0
  135. package/story-elements/Blurb/index.js +2094 -0
  136. package/{Blurb → story-elements/Blurb}/styles.arrow.css +0 -0
  137. package/story-elements/Image/index.js +2711 -0
  138. package/{Image → story-elements/Image}/styles.arrow.css +0 -0
  139. package/story-elements/ImageGallery/index.js +2644 -0
  140. package/{ImageGallery → story-elements/ImageGallery}/styles.arrow.css +0 -0
  141. package/story-elements/ImageSlideshow/index.js +2955 -0
  142. package/{ImageSlideshow → story-elements/ImageSlideshow}/styles.arrow.css +0 -0
  143. package/story-elements/QuestionAnswer/index.js +2395 -0
  144. package/{QuestionAnswer → story-elements/QuestionAnswer}/styles.arrow.css +0 -0
  145. package/story-elements/Quote/index.js +2012 -0
  146. package/{Quote → story-elements/Quote}/styles.arrow.css +0 -0
  147. package/story-elements/Reference/index.js +2006 -0
  148. package/{Reference → story-elements/Reference}/styles.arrow.css +0 -0
  149. package/story-elements/StoryElement/index.js +1779 -0
  150. package/story-elements/Summary/index.js +2036 -0
  151. package/{Summary → story-elements/Summary}/styles.arrow.css +0 -0
  152. package/story-elements/Text/index.js +2293 -0
  153. package/{Text → story-elements/Text}/styles.arrow.css +0 -0
  154. package/story-elements/Video/index.js +1785 -0
  155. package/{Video → story-elements/Video}/styles.arrow.css +0 -0
  156. package/story-templates/ListicleStoryTemplate/index.js +8442 -0
  157. package/{ListicleStoryTemplate → story-templates/ListicleStoryTemplate}/styles.arrow.css +0 -0
  158. package/story-templates/LiveBlogStoryTemplate/index.js +8618 -0
  159. package/{LiveBlogStoryTemplate → story-templates/LiveBlogStoryTemplate}/styles.arrow.css +0 -0
  160. package/story-templates/PhotoStoryTemplate/index.js +8420 -0
  161. package/{PhotoStoryTemplate → story-templates/PhotoStoryTemplate}/styles.arrow.css +0 -0
  162. package/story-templates/TextStoryTemplate/index.js +8493 -0
  163. package/{TextStoryTemplate → story-templates/TextStoryTemplate}/styles.arrow.css +0 -0
  164. package/story-templates/VideoStoryTemplate/index.js +8352 -0
  165. package/{VideoStoryTemplate → story-templates/VideoStoryTemplate}/styles.arrow.css +0 -0
  166. package/cjs/index.js +0 -1
  167. package/esm/index.js +0 -1
@@ -0,0 +1,350 @@
1
+ import { a as get_1, c as _slicedToArray, d as clientWidth, _ as _getClassName, e as getStoryUrl, f as isExternalStory, g as getTextColor, r as rgbToHex } from './index-e39b3ca8.js';
2
+ import { Link, ResponsiveHeroImage } from '@quintype/components';
3
+ import PropTypes from 'prop-types';
4
+ import React from 'react';
5
+ import { useSelector } from 'react-redux';
6
+ import { u as useStateValue } from './index-aa8b8ab8.js';
7
+
8
+ var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
9
+ var _ref$width = _ref.width,
10
+ width = _ref$width === void 0 ? 40 : _ref$width,
11
+ _ref$height = _ref.height,
12
+ height = _ref$height === void 0 ? 30 : _ref$height,
13
+ _ref$iconColor = _ref.iconColor,
14
+ iconColor = _ref$iconColor === void 0 ? "#99B0CB" : _ref$iconColor;
15
+ return /*#__PURE__*/React.createElement("svg", {
16
+ width: width,
17
+ height: height,
18
+ viewBox: "0 0 102 76",
19
+ version: "1.1"
20
+ }, /*#__PURE__*/React.createElement("g", {
21
+ id: "demo-home-copy",
22
+ stroke: "none",
23
+ strokeWidth: "1",
24
+ fill: "none",
25
+ fillRule: "evenodd",
26
+ transform: "translate(-377.000000, -314.000000)"
27
+ }, /*#__PURE__*/React.createElement("g", {
28
+ id: "Group-13",
29
+ transform: "translate(377.000000, 314.000000)"
30
+ }, /*#__PURE__*/React.createElement("path", {
31
+ d: "M43.2,49.7 L62.2,19.2 L87.2,59.4 L17,59.4 L32.8,39.4 L43.2,49.7 Z M29.9,28.6 C25.8683213,28.6 22.6,25.3316787 22.6,21.3 C22.6,17.2683213 25.8683213,14 29.9,14 C33.9316787,14 37.2,17.2683213 37.2,21.3 C37.2,25.3316787 33.9316787,28.6 29.9,28.6 Z",
32
+ id: "Combined-Shape",
33
+ fill: iconColor,
34
+ fillRule: "nonzero"
35
+ }), /*#__PURE__*/React.createElement("rect", {
36
+ id: "Rectangle-19",
37
+ stroke: iconColor,
38
+ strokeWidth: "3",
39
+ x: "1.5",
40
+ y: "1.5",
41
+ width: "99",
42
+ height: "73",
43
+ rx: "3"
44
+ }))));
45
+ };
46
+ ImageFallbackIcon.propTypes = {
47
+ width: PropTypes.object,
48
+ height: PropTypes.object,
49
+ iconColor: PropTypes.object
50
+ };
51
+
52
+ var imageFallback = function imageFallback() {
53
+ return /*#__PURE__*/React.createElement("div", {
54
+ className: "arr--fallback-image fallback-m_image__1GYCJ fallback-m_image-position__3KddP"
55
+ }, /*#__PURE__*/React.createElement("figure", {
56
+ className: "arr--fallback-svg fallback-m_fallback-svg__tK9fL"
57
+ }, /*#__PURE__*/React.createElement(ImageFallbackIcon, null)));
58
+ };
59
+
60
+ var FallbackImage = function FallbackImage(_ref) {
61
+ var slug = _ref.slug;
62
+
63
+ if (slug) {
64
+ return /*#__PURE__*/React.createElement(Link, {
65
+ href: slug,
66
+ "aria-label": "image-fallback"
67
+ }, imageFallback());
68
+ } else {
69
+ return imageFallback();
70
+ }
71
+ };
72
+ FallbackImage.propTypes = {
73
+ slug: PropTypes.string
74
+ };
75
+
76
+ var HyperLinkIcon = function HyperLinkIcon() {
77
+ return /*#__PURE__*/React.createElement("svg", {
78
+ xmlns: "http://www.w3.org/2000/svg",
79
+ width: "36",
80
+ height: "28"
81
+ }, /*#__PURE__*/React.createElement("g", {
82
+ fill: "none",
83
+ fillRule: "evenodd"
84
+ }, /*#__PURE__*/React.createElement("rect", {
85
+ width: "36",
86
+ height: "28",
87
+ fill: "#3D6FCF",
88
+ rx: "4"
89
+ }), /*#__PURE__*/React.createElement("path", {
90
+ stroke: "#FFF",
91
+ strokeLinecap: "round",
92
+ strokeLinejoin: "round",
93
+ strokeWidth: "2",
94
+ d: "M22 14.667v4c0 .736-.597 1.333-1.333 1.333h-7.334A1.333 1.333 0 0112 18.667v-7.334c0-.736.597-1.333 1.333-1.333h4M20 8h4v4m-7.333 3.333L24 8"
95
+ })));
96
+ };
97
+
98
+ var HyperLink = function HyperLink(_ref) {
99
+ var _ref$hyperLink = _ref.hyperLink,
100
+ hyperLink = _ref$hyperLink === void 0 ? "" : _ref$hyperLink;
101
+ if (!hyperLink) return null;
102
+ return /*#__PURE__*/React.createElement(Link, {
103
+ href: hyperLink,
104
+ "aria-label": "hyperlink-button",
105
+ className: "arr--hyperlink-button hyperlink-m_hyperlink-button__1CqWx",
106
+ target: "_blank",
107
+ rel: "noopener noreferrer"
108
+ }, /*#__PURE__*/React.createElement(HyperLinkIcon, null));
109
+ };
110
+ HyperLink.propTypes = {
111
+ hyperLink: PropTypes.string
112
+ };
113
+
114
+ var _styleModuleImportMap$1 = {
115
+ "./hero-image.m.css": {
116
+ "hero-image": "hero-image-m_hero-image__3lraV",
117
+ "right-padding": "hero-image-m_right-padding__1LkCe",
118
+ "left-padding": "hero-image-m_left-padding__pYRAj",
119
+ "right-padding-mob": "hero-image-m_right-padding-mob__3-uOU",
120
+ "placeholder": "hero-image-m_placeholder__1omCm",
121
+ "hero-image-mob": "hero-image-m_hero-image-mob__13JJp",
122
+ "with-padding": "hero-image-m_with-padding__324G_",
123
+ "image": "hero-image-m_image__1mz0U"
124
+ }
125
+ };
126
+ var HeroImage = function HeroImage(_ref) {
127
+ var story = _ref.story,
128
+ FullBleed = _ref.FullBleed,
129
+ aspectRatio = _ref.aspectRatio,
130
+ defaultWidth = _ref.defaultWidth,
131
+ widths = _ref.widths,
132
+ isHorizontal = _ref.isHorizontal,
133
+ isHorizontalMobile = _ref.isHorizontalMobile,
134
+ isHorizontalWithImageLast = _ref.isHorizontalWithImageLast,
135
+ defaultFallback = _ref.defaultFallback,
136
+ isStoryPageImage = _ref.isStoryPageImage,
137
+ config = _ref.config;
138
+
139
+ var _ref2 = useStateValue() || {},
140
+ _ref2$fallbackImageUr = _ref2.fallbackImageUrl,
141
+ fallbackImageUrl = _ref2$fallbackImageUr === void 0 ? "" : _ref2$fallbackImageUr;
142
+
143
+ var _config$StoryTemplate = config.StoryTemplateIcon,
144
+ StoryTemplateIcon = _config$StoryTemplate === void 0 ? function () {
145
+ return null;
146
+ } : _config$StoryTemplate;
147
+ var showImagePlaceholder = useSelector(function (state) {
148
+ return get_1(state, ["qt", "config", "showPlaceholder"]);
149
+ });
150
+ var getPlaceholderStyleName = showImagePlaceholder ? "placeholder" : "";
151
+ var fullBleed = FullBleed ? "" : "with-padding";
152
+ var heroImageClass = "hero-image";
153
+ if (isHorizontal) heroImageClass = "right-padding";else if (isHorizontalWithImageLast) heroImageClass = "left-padding";
154
+ var heroImageMobClasses = isHorizontalMobile ? "right-padding-mob" : "";
155
+
156
+ var getPadding = function getPadding(aspectRatio) {
157
+ var _aspectRatio = _slicedToArray(aspectRatio, 2),
158
+ height = _aspectRatio[0],
159
+ width = _aspectRatio[1];
160
+
161
+ if (height > 0 && width > 0) {
162
+ var padding = width / height * 100;
163
+ return padding;
164
+ }
165
+
166
+ return 0;
167
+ };
168
+
169
+ var _aspectRatio2 = _slicedToArray(aspectRatio, 2),
170
+ mobileAspectRatio = _aspectRatio2[0],
171
+ _aspectRatio2$ = _aspectRatio2[1],
172
+ desktopAspectRatio = _aspectRatio2$ === void 0 ? mobileAspectRatio : _aspectRatio2$;
173
+
174
+ var isMobile = clientWidth("mobile");
175
+ var imageAspectRatio = isMobile ? mobileAspectRatio : desktopAspectRatio;
176
+ var imagePadding = isMobile ? getPadding(mobileAspectRatio) : getPadding(desktopAspectRatio);
177
+ var slug = get_1(story, ["hero-image-s3-key"]) || get_1(story, ["alternative", "home", "default", "hero-image", "hero-image-s3-key"]);
178
+ var hyperLink = get_1(story, ["hero-image-hyperlink"], "");
179
+
180
+ var fallbackImage = function fallbackImage() {
181
+ if (!slug) {
182
+ if (fallbackImageUrl && !isStoryPageImage) {
183
+ return /*#__PURE__*/React.createElement("figure", {
184
+ style: {
185
+ paddingTop: imagePadding + "%"
186
+ },
187
+ className: "arr--responsive-hero-image " + _getClassName("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$1)
188
+ }, /*#__PURE__*/React.createElement("img", {
189
+ className: "qt-image",
190
+ "data-src": "".concat(fallbackImageUrl),
191
+ alt: "image-fallback"
192
+ }));
193
+ }
194
+
195
+ return /*#__PURE__*/React.createElement(React.Fragment, null, defaultFallback ? /*#__PURE__*/React.createElement("div", {
196
+ "data-test-id": "arr--fallback-hero-image",
197
+ style: {
198
+ paddingTop: imagePadding + "%"
199
+ },
200
+ className: "arr--fallback-hero-image " + _getClassName("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$1)
201
+ }, /*#__PURE__*/React.createElement(StoryTemplateIcon, {
202
+ storyTemplate: story["story-template"]
203
+ }), /*#__PURE__*/React.createElement(FallbackImage, null)) : null);
204
+ }
205
+
206
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("figure", {
207
+ style: {
208
+ paddingTop: imagePadding + "%"
209
+ },
210
+ className: "arr--responsive-hero-image " + _getClassName("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$1)
211
+ }, /*#__PURE__*/React.createElement(StoryTemplateIcon, {
212
+ storyTemplate: story["story-template"]
213
+ }), /*#__PURE__*/React.createElement(ResponsiveHeroImage, {
214
+ story: story,
215
+ aspectRatio: imageAspectRatio,
216
+ defaultWidth: defaultWidth,
217
+ widths: widths,
218
+ imgParams: {
219
+ auto: ["format", "compress"],
220
+ fit: "max"
221
+ }
222
+ })), isStoryPageImage && hyperLink && /*#__PURE__*/React.createElement(HyperLink, {
223
+ hyperLink: hyperLink
224
+ }));
225
+ };
226
+
227
+ return story && (isStoryPageImage ? /*#__PURE__*/React.createElement("div", {
228
+ "data-test-id": "arr--hero-image",
229
+ className: "arr--hero-image " + _getClassName("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$1)
230
+ }, fallbackImage()) : /*#__PURE__*/React.createElement(Link, {
231
+ "data-test-id": "arr--hero-image",
232
+ href: getStoryUrl(story, "/".concat(story.slug)),
233
+ externalLink: isExternalStory(story),
234
+ "aria-label": "fallback-hero-image",
235
+ className: "arr--hero-image " + _getClassName("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$1)
236
+ }, fallbackImage()));
237
+ };
238
+ HeroImage.propTypes = {
239
+ /** The Story Object from the API response */
240
+ story: PropTypes.object.isRequired,
241
+
242
+ /** Removes the Hero Image padding for the image to bleed over the margin */
243
+ FullBleed: PropTypes.bool,
244
+
245
+ /** The default width for the image, in case the browser does not support srcset */
246
+ defaultWidth: PropTypes.number,
247
+
248
+ /** The list of available widths */
249
+ widths: PropTypes.array,
250
+ // fatch the correct hero image
251
+ aspectRatio: PropTypes.array,
252
+ // Hints for the browser to choose the best size
253
+
254
+ /** This prop is responsible for adding padding-right of the image and remove padding bottom of the image */
255
+ isHorizontal: PropTypes.bool,
256
+
257
+ /** This prop is responsible for adding padding-bottom in desktop and padding-right in mobile */
258
+ isHorizontalMobile: PropTypes.bool,
259
+ // this prop is responsive for rendering fallback image on story page
260
+ defaultFallback: PropTypes.bool,
261
+ isHorizontalWithImageLast: PropTypes.bool,
262
+ isStoryPageImage: PropTypes.bool,
263
+ config: PropTypes.object
264
+ };
265
+ HeroImage.defaultProps = {
266
+ FullBleed: true,
267
+ aspectRatio: [[1, 1], [16, 9]],
268
+ defaultWidth: 480,
269
+ widths: [250, 480, 640],
270
+ isHorizontal: false,
271
+ isHorizontalMobile: false,
272
+ defaultFallback: true,
273
+ isStoryPageImage: false,
274
+ isHorizontalWithImageLast: false,
275
+ config: {}
276
+ };
277
+
278
+ var _styleModuleImportMap = {
279
+ "./section.m.css": {
280
+ "section": "section-m_section__2N4S3",
281
+ "section-borderBottomSml": "section-m_section-borderBottomSml__2GNbo",
282
+ "border-bottom": "section-m_border-bottom__3cRoD",
283
+ "section-borderLeft": "section-m_section-borderLeft__3hKVj",
284
+ "border-left": "section-m_border-left__2oUyp",
285
+ "section-solid": "section-m_section-solid__1vB1Q",
286
+ "dark": "section-m_dark__1r3C4",
287
+ "light": "section-m_light__306hW"
288
+ }
289
+ };
290
+ var SectionTag = function SectionTag(_ref) {
291
+ var story = _ref.story,
292
+ _ref$template = _ref.template,
293
+ template = _ref$template === void 0 ? "" : _ref$template,
294
+ _ref$borderColor = _ref.borderColor,
295
+ borderColor = _ref$borderColor === void 0 ? "" : _ref$borderColor,
296
+ isLightTheme = _ref.isLightTheme;
297
+ var config = useStateValue() || {};
298
+ var isSection = get_1(config, ["showSection"], true);
299
+ var templateFromRowContext = get_1(config, ["sectionTagTemplate"]);
300
+ var section = get_1(story, ["sections", 0], "");
301
+ var supportedTemplates = ["borderBottomSml", "borderLeft", "solid"];
302
+ var getUrl = section ? section["section-url"] : "/";
303
+ var colorToApplyContrast = template === "solid" || templateFromRowContext === "solid" ? borderColor : config.theme;
304
+ var textColor = isLightTheme ? "light" : getTextColor(colorToApplyContrast);
305
+ var sectionTagBorderColor = rgbToHex(borderColor);
306
+ var templateStyle = supportedTemplates.includes(template) ? "section section-".concat(template) : "section";
307
+
308
+ if (templateFromRowContext) {
309
+ templateStyle = supportedTemplates.includes(templateFromRowContext) ? "section section-".concat(templateFromRowContext) : "section";
310
+ }
311
+
312
+ if (!isSection) return null;
313
+ return /*#__PURE__*/React.createElement(Link, {
314
+ href: getUrl,
315
+ className: "arrow-component arr--section-name",
316
+ "aria-label": "section-name"
317
+ }, /*#__PURE__*/React.createElement("div", {
318
+ "data-test-id": "sectionTag",
319
+ style: {
320
+ backgroundColor: templateStyle.includes("section-solid") ? sectionTagBorderColor : ""
321
+ },
322
+ className: "section-tag arrow-component " + _getClassName("".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap)
323
+ }, templateStyle.includes("section-borderLeft") && /*#__PURE__*/React.createElement("span", {
324
+ className: "section-m_border-left__2oUyp",
325
+ style: {
326
+ color: sectionTagBorderColor
327
+ }
328
+ }), section["display-name"] || section["name"], /*#__PURE__*/React.createElement("div", {
329
+ className: "section-m_border-bottom__3cRoD",
330
+ style: {
331
+ backgroundColor: "".concat(template === "solid" ? "" : sectionTagBorderColor)
332
+ }
333
+ })));
334
+ };
335
+ SectionTag.propTypes = {
336
+ /** The Story Object from the API response */
337
+ story: PropTypes.object.isRequired,
338
+
339
+ /** The style template for section tag */
340
+ template: PropTypes.oneOf(["", "borderBottomSml", "borderLeft", "solid"]),
341
+ borderColor: PropTypes.string,
342
+ solidBorderColor: PropTypes.string,
343
+ isLightTheme: PropTypes.bool
344
+ };
345
+ SectionTag.defaultProps = {
346
+ template: "",
347
+ isLightTheme: false
348
+ };
349
+
350
+ export { HeroImage as H, SectionTag as S };
@@ -0,0 +1,282 @@
1
+ import { C as CollectionName, b as Author, H as Headline, A as AuthorWithTime, S as StateProvider, _ as _defineProperty, L as LoadMoreTarget, P as ProgressiveHydration, a as LoadmoreButton } from './index-aa8b8ab8.js';
2
+ import { _ as _getClassName, a as get_1, g as getTextColor, l as getSlot, b as generateNavigateSlug, n as navigateTo } from './index-e39b3ca8.js';
3
+ import React from 'react';
4
+ import { useDispatch, useSelector } from 'react-redux';
5
+ import PropTypes from 'prop-types';
6
+ import { Link, ResponsiveImage, collectionToStories } from '@quintype/components';
7
+ import 'react-dom';
8
+ import 'react-timeago';
9
+ import 'date-fns-tz';
10
+
11
+ var UserFallbackIcon = function UserFallbackIcon(_ref) {
12
+ var _ref$width = _ref.width,
13
+ width = _ref$width === void 0 ? 120 : _ref$width,
14
+ _ref$height = _ref.height,
15
+ height = _ref$height === void 0 ? 120 : _ref$height;
16
+ return /*#__PURE__*/React.createElement("svg", {
17
+ width: width,
18
+ height: height,
19
+ viewBox: "0 0 120 120",
20
+ xmlns: "http://www.w3.org/2000/svg"
21
+ }, /*#__PURE__*/React.createElement("path", {
22
+ d: "M93.28 108.98c-1.055-17.675-15.47-31.678-33.098-31.678-17.708 0-32.173 14.129-33.11 31.916 9.415 6.311 20.741 9.993 32.927 9.993 12.338 0 23.795-3.774 33.28-10.23l.001-.001zM58.584 73.283c9.928 0 17.977-8.275 17.977-18.483 0-10.209-8.049-18.484-17.977-18.484-9.929 0-17.977 8.275-17.977 18.484 0 10.208 8.048 18.483 17.977 18.483zM60 120C26.863 120 0 93.137 0 60S26.863 0 60 0s60 26.863 60 60-26.863 60-60 60z",
23
+ fill: "#DADADA",
24
+ fillRule: "nonzero"
25
+ }));
26
+ };
27
+ UserFallbackIcon.propTypes = {
28
+ width: PropTypes.object,
29
+ height: PropTypes.object
30
+ };
31
+
32
+ var _styleModuleImportMap$1 = {
33
+ "./author-image.m.css": {
34
+ "viewports": "\"../../../../assets/stylesheets/viewports.m.css\"",
35
+ "mobile": "768px",
36
+ "tablet": "992px",
37
+ "image-container": "author-image-m_image-container__19WNd",
38
+ "author-image": "author-image-m_author-image__D8GMB",
39
+ "square": "author-image-m_square__bjK7M",
40
+ "small-circle": "author-image-m_small-circle__DbQMN",
41
+ "smaller-circle": "author-image-m_smaller-circle__2yMOZ"
42
+ }
43
+ };
44
+
45
+ var authorWithImage = function authorWithImage(author, templateStyle) {
46
+ var avatarUrl = author["avatar-url"],
47
+ avatarS3Key = author["avatar-s3-key"],
48
+ name = author.name;
49
+ return /*#__PURE__*/React.createElement("div", {
50
+ "data-test-id": "author-image",
51
+ className: "arr--author-image " + _getClassName("author-image ".concat(templateStyle), _styleModuleImportMap$1)
52
+ }, /*#__PURE__*/React.createElement("figure", {
53
+ className: "author-image-m_image-container__19WNd"
54
+ }, avatarS3Key ? /*#__PURE__*/React.createElement(ResponsiveImage, {
55
+ slug: avatarS3Key,
56
+ alt: name,
57
+ defaultWidth: 250,
58
+ widths: [250, 480],
59
+ aspectRatio: [[1, 1], [1, 1]],
60
+ sizes: "98vw",
61
+ imgParams: {
62
+ auto: ["format", "compress"]
63
+ }
64
+ }) : avatarUrl ? /*#__PURE__*/React.createElement("img", {
65
+ src: avatarUrl
66
+ }) : /*#__PURE__*/React.createElement(UserFallbackIcon, null)));
67
+ };
68
+
69
+ var AuthorImage = function AuthorImage(_ref) {
70
+ var _ref$author = _ref.author,
71
+ author = _ref$author === void 0 ? {} : _ref$author,
72
+ _ref$template = _ref.template,
73
+ template = _ref$template === void 0 ? "" : _ref$template,
74
+ _ref$config = _ref.config,
75
+ config = _ref$config === void 0 ? {} : _ref$config;
76
+ var slug = author.slug;
77
+ var mountAt = config.mountAt || "";
78
+ var templateStyle = "";
79
+ if (template === "smallerCircle") templateStyle = "smaller-circle";else if (template === "smallCircle") templateStyle = "small-circle";else if (template === "square") templateStyle = "square";
80
+ if (slug) return /*#__PURE__*/React.createElement(Link, {
81
+ href: "".concat(mountAt, "/author/") + slug
82
+ }, authorWithImage(author, templateStyle));else return authorWithImage(author, templateStyle);
83
+ };
84
+
85
+ AuthorImage.propTypes = {
86
+ author: PropTypes.shape({
87
+ "avatar-url": PropTypes.string,
88
+ "avatar-s3-key": PropTypes.string,
89
+ name: PropTypes.string,
90
+ slug: PropTypes.string
91
+ }),
92
+ template: PropTypes.string
93
+ };
94
+
95
+ var _styleModuleImportMap = {
96
+ "./opinion-collection.m.css": {
97
+ "viewports": "\"../../../../assets/stylesheets/viewports.m.css\"",
98
+ "mobile": "768px",
99
+ "desktop": "1025px",
100
+ "opinion-collection": "opinion-collection-m_opinion-collection__1Bc7h",
101
+ "content-wrapper": "opinion-collection-m_content-wrapper__y32PE",
102
+ "custom-grid": "opinion-collection-m_custom-grid__33uRh",
103
+ "wrapper-with-ads": "opinion-collection-m_wrapper-with-ads__2daVe",
104
+ "ad-slot": "opinion-collection-m_ad-slot__2ZpaC",
105
+ "headline-author": "opinion-collection-m_headline-author__2H6Tv",
106
+ "border": "opinion-collection-m_border__38tun",
107
+ "light": "opinion-collection-m_light__2Hent",
108
+ "dark": "opinion-collection-m_dark__WMRNF",
109
+ "count-3": "opinion-collection-m_count-3__3cQUB",
110
+ "count-2": "opinion-collection-m_count-2__2e7g_"
111
+ }
112
+ };
113
+
114
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
115
+
116
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
117
+
118
+ var loadMore = function loadMore(_ref) {
119
+ var isLoading = _ref.isLoading,
120
+ renderStories = _ref.renderStories,
121
+ getMoreStories = _ref.getMoreStories,
122
+ _ref$subsequentLoadCo = _ref.subsequentLoadCount,
123
+ subsequentLoadCount = _ref$subsequentLoadCo === void 0 ? 3 : _ref$subsequentLoadCo;
124
+ if (isLoading) return;
125
+ var limit = subsequentLoadCount;
126
+ var offset = renderStories.length;
127
+ getMoreStories(offset, limit);
128
+ };
129
+
130
+ var OpinionCollectionBase = function OpinionCollectionBase(_ref2) {
131
+ var collection = _ref2.collection,
132
+ config = _ref2.config,
133
+ getMoreStories = _ref2.getMoreStories,
134
+ isLoadMoreVisible = _ref2.isLoadMoreVisible,
135
+ isLoading = _ref2.isLoading,
136
+ isolatedLoadMore = _ref2.isolatedLoadMore;
137
+ var stories = collectionToStories(collection);
138
+ var _config$theme = config.theme,
139
+ theme = _config$theme === void 0 ? "" : _config$theme,
140
+ _config$footerButton = config.footerButton,
141
+ footerButton = _config$footerButton === void 0 ? "" : _config$footerButton,
142
+ _config$border = config.border,
143
+ border = _config$border === void 0 ? "fullBorder" : _config$border,
144
+ _config$collectionNam = config.collectionNameBorderColor,
145
+ collectionNameBorderColor = _config$collectionNam === void 0 ? "" : _config$collectionNam,
146
+ _config$collectionNam2 = config.collectionNameTemplate,
147
+ collectionNameTemplate = _config$collectionNam2 === void 0 ? "" : _config$collectionNam2,
148
+ _config$slotConfig = config.slotConfig,
149
+ slotConfig = _config$slotConfig === void 0 ? [] : _config$slotConfig,
150
+ _config$subsequentLoa = config.subsequentLoadCount,
151
+ subsequentLoadCount = _config$subsequentLoa === void 0 ? 3 : _config$subsequentLoa;
152
+
153
+ var _get = get_1(slotConfig, [0], {}),
154
+ _get$type = _get.type,
155
+ type = _get$type === void 0 ? "story" : _get$type,
156
+ _get$component = _get.component,
157
+ component = _get$component === void 0 ? null : _get$component;
158
+
159
+ var dispatch = useDispatch();
160
+ var qtConfig = useSelector(function (state) {
161
+ return get_1(state, ["qt", "config"], {});
162
+ });
163
+ if (!stories.length) return null;
164
+ var textColor = getTextColor(theme);
165
+ var borderStyle = border === "fullBorder" ? "border" : "";
166
+ var slot = type === "ad" ? getSlot(type, component) : null;
167
+ var adStyle = slot ? "custom-grid" : "";
168
+
169
+ var getLoadMore = function getLoadMore(opts) {
170
+ if (!isLoadMoreVisible) return null;
171
+
172
+ if (isolatedLoadMore) {
173
+ return /*#__PURE__*/React.createElement(LoadMoreTarget, {
174
+ collection: collection,
175
+ componentName: "OpinionCollection",
176
+ offset: stories.length,
177
+ limit: subsequentLoadCount
178
+ });
179
+ }
180
+
181
+ var url = generateNavigateSlug(collection, qtConfig);
182
+ return /*#__PURE__*/React.createElement(ProgressiveHydration, null, /*#__PURE__*/React.createElement(LoadmoreButton, {
183
+ config: config,
184
+ collection: collection,
185
+ template: footerButton,
186
+ onClick: function onClick() {
187
+ return loadMore(opts);
188
+ },
189
+ navigate: function navigate() {
190
+ return navigateTo(dispatch, url);
191
+ },
192
+ qtConfig: qtConfig
193
+ }));
194
+ };
195
+
196
+ var getAuthorCard = function getAuthorCard(story) {
197
+ var authorData = get_1(story, ["authors", "0"]);
198
+ return /*#__PURE__*/React.createElement("div", {
199
+ "data-test-id": "story-card"
200
+ }, /*#__PURE__*/React.createElement(Author, {
201
+ story: story,
202
+ hideAuthorImage: true
203
+ }), /*#__PURE__*/React.createElement("div", {
204
+ className: "opinion-collection-m_headline-author__2H6Tv"
205
+ }, /*#__PURE__*/React.createElement(Headline, {
206
+ story: story
207
+ }), /*#__PURE__*/React.createElement(AuthorImage, {
208
+ author: authorData,
209
+ template: "smallerCircle",
210
+ config: config
211
+ })), /*#__PURE__*/React.createElement(AuthorWithTime, {
212
+ story: story,
213
+ config: _objectSpread(_objectSpread({}, config), {}, {
214
+ disableMeridiem: true,
215
+ showAuthor: false
216
+ })
217
+ }));
218
+ };
219
+
220
+ var countStyleName = stories.length === 2 || stories.length === 3 ? "count-".concat(stories.length) : "";
221
+ return /*#__PURE__*/React.createElement("div", {
222
+ className: "full-width-with-padding arrow-component",
223
+ "data-test-id": "opinion-collection",
224
+ style: {
225
+ backgroundColor: theme,
226
+ color: textColor
227
+ }
228
+ }, /*#__PURE__*/React.createElement("div", {
229
+ className: "opinion-collection-m_opinion-collection__1Bc7h",
230
+ style: {
231
+ backgroundColor: theme,
232
+ color: textColor
233
+ }
234
+ }, /*#__PURE__*/React.createElement(CollectionName, {
235
+ collection: collection,
236
+ collectionNameTemplate: collectionNameTemplate,
237
+ collectionNameBorderColor: collectionNameBorderColor,
238
+ headerLevel: 2
239
+ }), /*#__PURE__*/React.createElement("div", {
240
+ className: ("content-wrapper ".concat(borderStyle, " ").concat(textColor) ? "content-wrapper ".concat(borderStyle, " ").concat(textColor) + " " : "") + _getClassName("content-wrapper ".concat(borderStyle, " ").concat(textColor, " ").concat(adStyle), _styleModuleImportMap)
241
+ }, slot ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
242
+ className: "wrapper-with-ads " + _getClassName("wrapper-with-ads ".concat(countStyleName), _styleModuleImportMap)
243
+ }, stories.slice(0, 4).map(function (story) {
244
+ return getAuthorCard(story);
245
+ })), /*#__PURE__*/React.createElement("div", {
246
+ className: "opinion-collection-m_ad-slot__2ZpaC"
247
+ }, slot)) : stories.map(function (story) {
248
+ return getAuthorCard(story);
249
+ })), getLoadMore({
250
+ isLoading: isLoading,
251
+ stories: stories,
252
+ getMoreStories: getMoreStories,
253
+ subsequentLoadCount: subsequentLoadCount
254
+ })));
255
+ };
256
+ OpinionCollectionBase.propTypes = {
257
+ collection: PropTypes.object,
258
+ config: PropTypes.shape({
259
+ collectionNameBorderColor: PropTypes.string,
260
+ theme: PropTypes.string,
261
+ collectionNameTemplate: PropTypes.string,
262
+ footerButton: PropTypes.string,
263
+ border: PropTypes.string,
264
+ slotConfig: PropTypes.array,
265
+ subsequentLoadCount: PropTypes.number
266
+ }),
267
+ getMoreStories: PropTypes.func,
268
+ isLoading: PropTypes.bool,
269
+ isLoadMoreVisible: PropTypes.bool,
270
+ isolatedLoadMore: PropTypes.bool
271
+ };
272
+ OpinionCollectionBase.defaultProps = {
273
+ getMoreStories: function getMoreStories() {},
274
+ isLoadMoreVisible: true,
275
+ isLoading: false,
276
+ collection: {},
277
+ config: {},
278
+ hideFirstCard: false
279
+ };
280
+ var OpinionCollection = StateProvider(OpinionCollectionBase);
281
+
282
+ export { OpinionCollection, OpinionCollectionBase };