@quintype/arrow 3.15.1-perf.3 → 3.15.1-perf.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/cjs/index.js +14589 -0
- package/esm/components/Atoms/AdPlaceholder/ads.m.css +13 -0
- package/esm/components/Atoms/AdPlaceholder/index.js +28 -0
- package/esm/components/Atoms/Author/README.md +19 -0
- package/esm/components/Atoms/Author/author.m.css +65 -0
- package/esm/components/Atoms/Author/index.js +109 -0
- package/esm/components/Atoms/Author/stories.js +28 -0
- package/esm/components/Atoms/AuthorCard/README.md +47 -0
- package/esm/components/Atoms/AuthorCard/author-card.m.css +174 -0
- package/esm/components/Atoms/AuthorCard/author-card.test.js +93 -0
- package/esm/components/Atoms/AuthorCard/index.js +133 -0
- package/esm/components/Atoms/AuthorCard/stories.js +68 -0
- package/esm/components/Atoms/AuthorImage/README.md +31 -0
- package/esm/components/Atoms/AuthorImage/author-image.m.css +53 -0
- package/esm/components/Atoms/AuthorImage/index.js +69 -0
- package/esm/components/Atoms/AuthorImage/stories.js +26 -0
- package/esm/components/Atoms/AuthorWithTimestamp/README.md +12 -0
- package/esm/components/Atoms/AuthorWithTimestamp/author-with-timestamp.m.css +42 -0
- package/esm/components/Atoms/AuthorWithTimestamp/index.js +95 -0
- package/esm/components/Atoms/AuthorWithTimestamp/stories.js +22 -0
- package/esm/components/Atoms/BulletPoint/README.md +9 -0
- package/esm/components/Atoms/BulletPoint/bullet-point.m.css +14 -0
- package/esm/components/Atoms/BulletPoint/index.js +27 -0
- package/esm/components/Atoms/BulletPoint/stories.js +9 -0
- package/esm/components/Atoms/CaptionAttribution/README.md +15 -0
- package/esm/components/Atoms/CaptionAttribution/caption-attribution.m.css +40 -0
- package/esm/components/Atoms/CaptionAttribution/caption-attribution.test.js +50 -0
- package/esm/components/Atoms/CaptionAttribution/index.js +66 -0
- package/esm/components/Atoms/CaptionAttribution/stories.js +47 -0
- package/esm/components/Atoms/CollectionName/README.md +11 -0
- package/esm/components/Atoms/CollectionName/collection-name.m.css +94 -0
- package/esm/components/Atoms/CollectionName/index.js +152 -0
- package/esm/components/Atoms/CollectionName/stories.js +41 -0
- package/esm/components/Atoms/Divider/__snapshots__/divider.test.js.snap +18 -0
- package/esm/components/Atoms/Divider/divider.m.css +6 -0
- package/esm/components/Atoms/Divider/divider.test.js +9 -0
- package/esm/components/Atoms/Divider/index.js +34 -0
- package/esm/components/Atoms/Dot/dot.js +39 -0
- package/esm/components/Atoms/Dot/dot.m.css +6 -0
- package/esm/components/Atoms/ExtendedLoadMore/README.md +9 -0
- package/esm/components/Atoms/ExtendedLoadMore/__snapshots__/extended-load-more.test.js.snap +11 -0
- package/esm/components/Atoms/ExtendedLoadMore/extended-load-more.test.js +14 -0
- package/esm/components/Atoms/ExtendedLoadMore/index.js +183 -0
- package/esm/components/Atoms/FallbackImage/fallback.m.css +33 -0
- package/esm/components/Atoms/FallbackImage/index.js +29 -0
- package/esm/components/Atoms/Headline/README.md +7 -0
- package/esm/components/Atoms/Headline/headline.m.css +26 -0
- package/esm/components/Atoms/Headline/index.js +97 -0
- package/esm/components/Atoms/Headline/stories.js +39 -0
- package/esm/components/Atoms/HeroImage/README.md +13 -0
- package/esm/components/Atoms/HeroImage/hero-image.m.css +72 -0
- package/esm/components/Atoms/HeroImage/index.js +175 -0
- package/esm/components/Atoms/HeroImage/stories.js +23 -0
- package/esm/components/Atoms/Hyperlink/hyperlink.m.css +10 -0
- package/esm/components/Atoms/Hyperlink/index.js +20 -0
- package/esm/components/Atoms/LoadMoreTarget/index.js +24 -0
- package/esm/components/Atoms/Loadmore/README.md +0 -0
- package/esm/components/Atoms/Loadmore/__snapshots__/load-more.test.js.snap +25 -0
- package/esm/components/Atoms/Loadmore/index.js +61 -0
- package/esm/components/Atoms/Loadmore/load-more.m.css +23 -0
- package/esm/components/Atoms/Loadmore/load-more.test.js +26 -0
- package/esm/components/Atoms/Loadmore/stories.js +17 -0
- package/esm/components/Atoms/MagazineCoverImage/README.md +21 -0
- package/esm/components/Atoms/MagazineCoverImage/index.js +58 -0
- package/esm/components/Atoms/MagazineCoverImage/magazine-cover-image.m.css +24 -0
- package/esm/components/Atoms/MagazineCoverImage/stories.js +22 -0
- package/esm/components/Atoms/PremiumStoryIcon/index.js +54 -0
- package/esm/components/Atoms/PublishDetail/README.md +15 -0
- package/esm/components/Atoms/PublishDetail/index.js +104 -0
- package/esm/components/Atoms/PublishDetail/publish-details.m.css +47 -0
- package/esm/components/Atoms/PublishDetail/publish-details.test.js +38 -0
- package/esm/components/Atoms/PublishDetail/stories.js +20 -0
- package/esm/components/Atoms/ReadTime/README.md +13 -0
- package/esm/components/Atoms/ReadTime/index.js +46 -0
- package/esm/components/Atoms/ReadTime/read-time.m.css +25 -0
- package/esm/components/Atoms/ReadTime/read-time.test.js +29 -0
- package/esm/components/Atoms/ReadTime/stories.js +15 -0
- package/esm/components/Atoms/ScrollSnap/SliderArrow/index.js +64 -0
- package/esm/components/Atoms/ScrollSnap/SliderArrow/slider-arrow.m.css +45 -0
- package/esm/components/Atoms/ScrollSnap/SliderIndicator/index.js +53 -0
- package/esm/components/Atoms/ScrollSnap/SliderIndicator/slider-indicator.m.css +71 -0
- package/esm/components/Atoms/ScrollSnap/index.js +165 -0
- package/esm/components/Atoms/ScrollSnap/scroll-snap.m.css +27 -0
- package/esm/components/Atoms/SectionTag/README.md +11 -0
- package/esm/components/Atoms/SectionTag/index.js +79 -0
- package/esm/components/Atoms/SectionTag/section.m.css +53 -0
- package/esm/components/Atoms/SectionTag/stories.js +22 -0
- package/esm/components/Atoms/SocialSharePopup/README.md +25 -0
- package/esm/components/Atoms/SocialSharePopup/__snapshots__/social-share-popup.test.js.snap +653 -0
- package/esm/components/Atoms/SocialSharePopup/index.js +100 -0
- package/esm/components/Atoms/SocialSharePopup/social-share-popup.m.css +109 -0
- package/esm/components/Atoms/SocialSharePopup/social-share-popup.test.js +87 -0
- package/esm/components/Atoms/SocialSharePopup/stories.js +18 -0
- package/esm/components/Atoms/StoryElements/AlsoRead/README.md +49 -0
- package/esm/components/Atoms/StoryElements/AlsoRead/also-read.m.css +135 -0
- package/esm/components/Atoms/StoryElements/AlsoRead/also-read.test.js +97 -0
- package/esm/components/Atoms/StoryElements/AlsoRead/index.js +156 -0
- package/esm/components/Atoms/StoryElements/AlsoRead/stories.js +47 -0
- package/esm/components/Atoms/StoryElements/Attachment/README.md +21 -0
- package/esm/components/Atoms/StoryElements/Attachment/__snapshots__/attachment.test.js.snap +47 -0
- package/esm/components/Atoms/StoryElements/Attachment/attachment.m.css +125 -0
- package/esm/components/Atoms/StoryElements/Attachment/attachment.test.js +66 -0
- package/esm/components/Atoms/StoryElements/Attachment/index.js +86 -0
- package/esm/components/Atoms/StoryElements/Attachment/stories.js +62 -0
- package/esm/components/Atoms/StoryElements/BigFact/README.md +9 -0
- package/esm/components/Atoms/StoryElements/BigFact/big-fact.m.css +41 -0
- package/esm/components/Atoms/StoryElements/BigFact/big-fact.test.js +28 -0
- package/esm/components/Atoms/StoryElements/BigFact/index.js +56 -0
- package/esm/components/Atoms/StoryElements/BigFact/stories.js +11 -0
- package/esm/components/Atoms/StoryElements/BlockQuote/README.md +49 -0
- package/esm/components/Atoms/StoryElements/BlockQuote/Svg/curve.js +32 -0
- package/esm/components/Atoms/StoryElements/BlockQuote/Svg/edge.js +32 -0
- package/esm/components/Atoms/StoryElements/BlockQuote/Svg/icon.m.css +4 -0
- package/esm/components/Atoms/StoryElements/BlockQuote/block-quote.m.css +161 -0
- package/esm/components/Atoms/StoryElements/BlockQuote/block-quote.test.js +71 -0
- package/esm/components/Atoms/StoryElements/BlockQuote/index.js +154 -0
- package/esm/components/Atoms/StoryElements/BlockQuote/stories.js +42 -0
- package/esm/components/Atoms/StoryElements/Blurb/README.md +43 -0
- package/esm/components/Atoms/StoryElements/Blurb/blurb.m.css +55 -0
- package/esm/components/Atoms/StoryElements/Blurb/blurb.test.js +76 -0
- package/esm/components/Atoms/StoryElements/Blurb/index.js +96 -0
- package/esm/components/Atoms/StoryElements/Blurb/stories.js +38 -0
- package/esm/components/Atoms/StoryElements/Image/README.md +13 -0
- package/esm/components/Atoms/StoryElements/Image/image.m.css +21 -0
- package/esm/components/Atoms/StoryElements/Image/image.test.js +19 -0
- package/esm/components/Atoms/StoryElements/Image/index.js +87 -0
- package/esm/components/Atoms/StoryElements/Image/stories.js +28 -0
- package/esm/components/Atoms/StoryElements/ImageSlideshow/README.md +13 -0
- package/esm/components/Atoms/StoryElements/ImageSlideshow/image-slideshow.m.css +49 -0
- package/esm/components/Atoms/StoryElements/ImageSlideshow/index.js +82 -0
- package/esm/components/Atoms/StoryElements/ImageSlideshow/stories.js +31 -0
- package/esm/components/Atoms/StoryElements/QuestionAnswer/README.md +56 -0
- package/esm/components/Atoms/StoryElements/QuestionAnswer/index.js +176 -0
- package/esm/components/Atoms/StoryElements/QuestionAnswer/question-answer.m.css +106 -0
- package/esm/components/Atoms/StoryElements/QuestionAnswer/question-answer.test.js +130 -0
- package/esm/components/Atoms/StoryElements/QuestionAnswer/stories.js +102 -0
- package/esm/components/Atoms/StoryElements/Quote/README.md +41 -0
- package/esm/components/Atoms/StoryElements/Quote/index.js +87 -0
- package/esm/components/Atoms/StoryElements/Quote/quote.m.css +111 -0
- package/esm/components/Atoms/StoryElements/Quote/quote.test.js +61 -0
- package/esm/components/Atoms/StoryElements/Quote/stories.js +39 -0
- package/esm/components/Atoms/StoryElements/Reference/README.md +9 -0
- package/esm/components/Atoms/StoryElements/Reference/index.js +80 -0
- package/esm/components/Atoms/StoryElements/Reference/reference.m.css +42 -0
- package/esm/components/Atoms/StoryElements/Reference/reference.test.js +38 -0
- package/esm/components/Atoms/StoryElements/Reference/stories.js +16 -0
- package/esm/components/Atoms/StoryElements/StoryElement/README.md +10 -0
- package/esm/components/Atoms/StoryElements/StoryElement/index.js +30 -0
- package/esm/components/Atoms/StoryElements/StoryElement/stories.js +17 -0
- package/esm/components/Atoms/StoryElements/StoryElement/storyelement.test.js +14 -0
- package/esm/components/Atoms/StoryElements/Summary/README.md +56 -0
- package/esm/components/Atoms/StoryElements/Summary/index.js +98 -0
- package/esm/components/Atoms/StoryElements/Summary/stories.js +41 -0
- package/esm/components/Atoms/StoryElements/Summary/summary.m.css +121 -0
- package/esm/components/Atoms/StoryElements/Summary/summary.test.js +83 -0
- package/esm/components/Atoms/StoryElements/Text/README.md +32 -0
- package/esm/components/Atoms/StoryElements/Text/index.js +74 -0
- package/esm/components/Atoms/StoryElements/Text/stories.js +56 -0
- package/esm/components/Atoms/StoryElements/Text/text.m.css +78 -0
- package/esm/components/Atoms/StoryElements/Text/text.test.js +70 -0
- package/esm/components/Atoms/StoryElements/Video/README.md +9 -0
- package/esm/components/Atoms/StoryElements/Video/index.js +37 -0
- package/esm/components/Atoms/StoryElements/Video/stories.js +29 -0
- package/esm/components/Atoms/StoryElements/Video/video.m.css +89 -0
- package/esm/components/Atoms/StoryElements/Video/video.test.js +14 -0
- package/esm/components/Atoms/StoryElements/imageGallery/README.md +18 -0
- package/esm/components/Atoms/StoryElements/imageGallery/image-gallery.m.css +52 -0
- package/esm/components/Atoms/StoryElements/imageGallery/image-gallery.test.js +17 -0
- package/esm/components/Atoms/StoryElements/imageGallery/index.js +112 -0
- package/esm/components/Atoms/StoryElements/imageGallery/stories.js +22 -0
- package/esm/components/Atoms/StoryElements/withElementWrapper.js +21 -0
- package/esm/components/Atoms/StoryElements/withElementWrapper.test.js +49 -0
- package/esm/components/Atoms/StoryHeadline/index.js +57 -0
- package/esm/components/Atoms/StoryHeadline/story-headline.m.css +36 -0
- package/esm/components/Atoms/StoryTags/README.md +9 -0
- package/esm/components/Atoms/StoryTags/index.js +47 -0
- package/esm/components/Atoms/StoryTags/stories.js +23 -0
- package/esm/components/Atoms/StoryTags/story-tags.test.js +16 -0
- package/esm/components/Atoms/StoryTags/tags.m.css +34 -0
- package/esm/components/Atoms/Subheadline/README.md +17 -0
- package/esm/components/Atoms/Subheadline/index.js +52 -0
- package/esm/components/Atoms/Subheadline/stories.js +21 -0
- package/esm/components/Atoms/Subheadline/subheadline.m.css +17 -0
- package/esm/components/Atoms/TimeStamp/README.md +9 -0
- package/esm/components/Atoms/TimeStamp/index.js +39 -0
- package/esm/components/Atoms/TimeStamp/stories.js +11 -0
- package/esm/components/Atoms/TimeStamp/timestamp.m.css +22 -0
- package/esm/components/Fixture/config.json +2703 -0
- package/esm/components/Fixture/dummy-collection.js +2547 -0
- package/esm/components/Fixture/dummyStory.js +2089 -0
- package/esm/components/Fixture/index.js +433 -0
- package/esm/components/Fixture/slot-config.js +26 -0
- package/esm/components/Molecules/FullScreenImages/fullscreenimages.scss +56 -0
- package/esm/components/Molecules/FullScreenImages/index.js +119 -0
- package/esm/components/Molecules/KeyEvents/README.md +21 -0
- package/esm/components/Molecules/KeyEvents/index.js +152 -0
- package/esm/components/Molecules/KeyEvents/key-events.m.css +89 -0
- package/esm/components/Molecules/KeyEvents/stories.js +25 -0
- package/esm/components/Molecules/PageIntroductionCard/README.md +25 -0
- package/esm/components/Molecules/PageIntroductionCard/index.js +77 -0
- package/esm/components/Molecules/PageIntroductionCard/page-intro-card.m.css +61 -0
- package/esm/components/Molecules/PageIntroductionCard/stories.js +17 -0
- package/esm/components/Molecules/PortraitStoryCard/README.md +10 -0
- package/esm/components/Molecules/PortraitStoryCard/index.js +52 -0
- package/esm/components/Molecules/PortraitStoryCard/portrait-story-card.m.css +38 -0
- package/esm/components/Molecules/PortraitStoryCard/stories.js +24 -0
- package/esm/components/Molecules/SliderHorizontalCard/README.md +14 -0
- package/esm/components/Molecules/SliderHorizontalCard/index.js +69 -0
- package/esm/components/Molecules/SliderHorizontalCard/slider-horizontal-card.m.css +42 -0
- package/esm/components/Molecules/SliderHorizontalCard/stories.js +27 -0
- package/esm/components/Molecules/SocialShareTemplate/README.md +118 -0
- package/esm/components/Molecules/SocialShareTemplate/__snapshots__/social-share-template.test.js.snap +738 -0
- package/esm/components/Molecules/SocialShareTemplate/index.js +164 -0
- package/esm/components/Molecules/SocialShareTemplate/social-share-data.js +90 -0
- package/esm/components/Molecules/SocialShareTemplate/social-share-template.m.css +174 -0
- package/esm/components/Molecules/SocialShareTemplate/social-share-template.test.js +108 -0
- package/esm/components/Molecules/SocialShareTemplate/stories.js +38 -0
- package/esm/components/Molecules/StoryCard/README.md +75 -0
- package/esm/components/Molecules/StoryCard/READMEBGIMAGE.md +25 -0
- package/esm/components/Molecules/StoryCard/READMEBORDER.md +61 -0
- package/esm/components/Molecules/StoryCard/index.js +200 -0
- package/esm/components/Molecules/StoryCard/stories.js +274 -0
- package/esm/components/Molecules/StoryCard/storycard.m.css +158 -0
- package/esm/components/Molecules/StoryCardWithBulletPoint/README.md +9 -0
- package/esm/components/Molecules/StoryCardWithBulletPoint/index.js +43 -0
- package/esm/components/Molecules/StoryCardWithBulletPoint/stories.js +28 -0
- package/esm/components/Molecules/StoryCardWithBulletPoint/story-card-with-bullet-point.m.css +7 -0
- package/esm/components/Molecules/StoryElementCard/README.md +9 -0
- package/esm/components/Molecules/StoryElementCard/index.js +494 -0
- package/esm/components/Molecules/StoryElementCard/stories.js +25 -0
- package/esm/components/Molecules/StoryElementCard/story-element-card.m.css +78 -0
- package/esm/components/Molecules/StorycardContent/README.md +34 -0
- package/esm/components/Molecules/StorycardContent/index.js +86 -0
- package/esm/components/Molecules/StorycardContent/stories.js +45 -0
- package/esm/components/Molecules/StorycardContent/storycardContent.m.css +21 -0
- package/esm/components/Rows/AlternateCollectionFilter/README.md +38 -0
- package/esm/components/Rows/AlternateCollectionFilter/alternate-collection-filter.m.css +254 -0
- package/esm/components/Rows/AlternateCollectionFilter/index.js +288 -0
- package/esm/components/Rows/AlternateCollectionFilter/stories.js +68 -0
- package/esm/components/Rows/AsideCollection/README.md +27 -0
- package/esm/components/Rows/AsideCollection/aside-collection.m.css +103 -0
- package/esm/components/Rows/AsideCollection/aside-collection.test.js +32 -0
- package/esm/components/Rows/AsideCollection/index.js +253 -0
- package/esm/components/Rows/AsideCollection/stories.js +48 -0
- package/esm/components/Rows/AstrologyCollection/README.md +40 -0
- package/esm/components/Rows/AstrologyCollection/astrology-collection.m.css +165 -0
- package/esm/components/Rows/AstrologyCollection/index.js +272 -0
- package/esm/components/Rows/AstrologyCollection/stories.js +61 -0
- package/esm/components/Rows/AuthorIntroductionCard/README.md +43 -0
- package/esm/components/Rows/AuthorIntroductionCard/author-intro.m.css +278 -0
- package/esm/components/Rows/AuthorIntroductionCard/author-intro.test.js +148 -0
- package/esm/components/Rows/AuthorIntroductionCard/index.js +157 -0
- package/esm/components/Rows/AuthorIntroductionCard/stories.js +46 -0
- package/esm/components/Rows/AuthorsList/README.md +24 -0
- package/esm/components/Rows/AuthorsList/author-list.test.js +66 -0
- package/esm/components/Rows/AuthorsList/authors-list.m.css +22 -0
- package/esm/components/Rows/AuthorsList/index.js +64 -0
- package/esm/components/Rows/AuthorsList/stories.js +62 -0
- package/esm/components/Rows/CollectionFilter/README.md +39 -0
- package/esm/components/Rows/CollectionFilter/collection-filter.m.css +213 -0
- package/esm/components/Rows/CollectionFilter/index.js +366 -0
- package/esm/components/Rows/CollectionFilter/stories.js +78 -0
- package/esm/components/Rows/ElevenStories/11-stories.m.css +85 -0
- package/esm/components/Rows/ElevenStories/README.md +39 -0
- package/esm/components/Rows/ElevenStories/index.js +418 -0
- package/esm/components/Rows/ElevenStories/stories.js +71 -0
- package/esm/components/Rows/FourColFiveStories/README.md +37 -0
- package/esm/components/Rows/FourColFiveStories/four-col-five-stories.m.css +112 -0
- package/{atoms/ExtendedLoadMore/index-3976fac4.js → esm/components/Rows/FourColFiveStories/index.js} +54 -64
- package/esm/components/Rows/FourColFiveStories/stories.js +67 -0
- package/esm/components/Rows/FourColGrid/README.md +39 -0
- package/esm/components/Rows/FourColGrid/four-col.m.css +50 -0
- package/{atoms/ExtendedLoadMore/index-bc129cb8.js → esm/components/Rows/FourColGrid/index.js} +52 -59
- package/esm/components/Rows/FourColGrid/stories.js +68 -0
- package/esm/components/Rows/FourColPortraitStories/README.md +38 -0
- package/esm/components/Rows/FourColPortraitStories/four-col-portrait-stories.m.css +45 -0
- package/esm/components/Rows/FourColPortraitStories/index.js +153 -0
- package/esm/components/Rows/FourColPortraitStories/stories.js +68 -0
- package/esm/components/Rows/FourColSixteenStories/README.md +35 -0
- package/esm/components/Rows/FourColSixteenStories/four-col-sixteen-stories.m.css +141 -0
- package/esm/components/Rows/FourColSixteenStories/index.js +157 -0
- package/esm/components/Rows/FourColSixteenStories/stories.js +43 -0
- package/esm/components/Rows/FourColTwelveStory/README.md +39 -0
- package/esm/components/Rows/FourColTwelveStory/four-col-twelve-story.m.css +71 -0
- package/esm/components/Rows/FourColTwelveStory/index.js +219 -0
- package/esm/components/Rows/FourColTwelveStory/stories.js +107 -0
- package/esm/components/Rows/FourStorySlider/README.md +45 -0
- package/esm/components/Rows/FourStorySlider/four-story-slider.m.css +78 -0
- package/esm/components/Rows/FourStorySlider/index.js +145 -0
- package/esm/components/Rows/FourStorySlider/stories.js +125 -0
- package/esm/components/Rows/FourStorySliderPortrait/README.md +45 -0
- package/esm/components/Rows/FourStorySliderPortrait/four-story-slider-portrait.m.css +221 -0
- package/esm/components/Rows/FourStorySliderPortrait/index.js +148 -0
- package/esm/components/Rows/FourStorySliderPortrait/stories.js +125 -0
- package/esm/components/Rows/FourTabbedBigStorySlider/README.md +39 -0
- package/esm/components/Rows/FourTabbedBigStorySlider/four-tabbed-big-story-slider.m.css +265 -0
- package/esm/components/Rows/FourTabbedBigStorySlider/index.js +221 -0
- package/esm/components/Rows/FourTabbedBigStorySlider/stories.js +59 -0
- package/esm/components/Rows/FullScreenSlider/README.md +46 -0
- package/esm/components/Rows/FullScreenSlider/full-screen-slider.m.css +155 -0
- package/esm/components/Rows/FullScreenSlider/index.js +140 -0
- package/esm/components/Rows/FullScreenSlider/stories.js +113 -0
- package/esm/components/Rows/HalfScreenSlider/README.md +43 -0
- package/esm/components/Rows/HalfScreenSlider/half-screen-slider.m.css +80 -0
- package/esm/components/Rows/HalfScreenSlider/index.js +124 -0
- package/esm/components/Rows/HalfScreenSlider/stories.js +118 -0
- package/esm/components/Rows/ListComponent/README.md +48 -0
- package/esm/components/Rows/ListComponent/index.js +176 -0
- package/esm/components/Rows/ListComponent/list-component.m.css +65 -0
- package/esm/components/Rows/ListComponent/stories.js +65 -0
- package/esm/components/Rows/Listicles/README.md +32 -0
- package/esm/components/Rows/Listicles/index.js +240 -0
- package/esm/components/Rows/Listicles/listicles.m.css +149 -0
- package/esm/components/Rows/Listicles/stories.js +53 -0
- package/esm/components/Rows/MagazineEditions/README.md +21 -0
- package/esm/components/Rows/MagazineEditions/index.js +123 -0
- package/esm/components/Rows/MagazineEditions/magazine-editions.m.css +50 -0
- package/esm/components/Rows/MagazineEditions/magazine-editions.test.js +30 -0
- package/esm/components/Rows/MagazineEditions/stories.js +41 -0
- package/esm/components/Rows/MagazineHeaderCard/README.md +21 -0
- package/esm/components/Rows/MagazineHeaderCard/index.js +117 -0
- package/esm/components/Rows/MagazineHeaderCard/magazine-cards.m.css +106 -0
- package/esm/components/Rows/MagazineHeaderCard/stories.js +34 -0
- package/esm/components/Rows/MagazineWidget/README.md +21 -0
- package/esm/components/Rows/MagazineWidget/index.js +177 -0
- package/esm/components/Rows/MagazineWidget/stories.js +40 -0
- package/esm/components/Rows/OneColStoryList/README.md +48 -0
- package/{atoms/ExtendedLoadMore/index-a5c95f84.js → esm/components/Rows/OneColStoryList/index.js} +69 -72
- package/esm/components/Rows/OneColStoryList/one-col-story-list.m.css +81 -0
- package/esm/components/Rows/OneColStoryList/stories.js +78 -0
- package/esm/components/Rows/OpinionCollection/README.md +36 -0
- package/esm/components/Rows/OpinionCollection/index.js +205 -0
- package/esm/components/Rows/OpinionCollection/opinion-collection.m.css +226 -0
- package/esm/components/Rows/OpinionCollection/stories.js +92 -0
- package/esm/components/Rows/SixColSixStories/README.md +37 -0
- package/{atoms/ExtendedLoadMore/index-6ecceae4.js → esm/components/Rows/SixColSixStories/index.js} +57 -61
- package/esm/components/Rows/SixColSixStories/six-col-six-stories.m.css +75 -0
- package/esm/components/Rows/SixColSixStories/stories.js +74 -0
- package/esm/components/Rows/StoryTemplates/ListicleStoryTemplates/README.md +19 -0
- package/esm/components/Rows/StoryTemplates/ListicleStoryTemplates/__snapshots__/listicle-story.test.js.snap +841 -0
- package/esm/components/Rows/StoryTemplates/ListicleStoryTemplates/index.js +330 -0
- package/esm/components/Rows/StoryTemplates/ListicleStoryTemplates/listicle-story.m.css +249 -0
- package/esm/components/Rows/StoryTemplates/ListicleStoryTemplates/listicle-story.test.js +46 -0
- package/esm/components/Rows/StoryTemplates/ListicleStoryTemplates/stories.js +119 -0
- package/esm/components/Rows/StoryTemplates/LiveBlogStoryTemplates/README.md +25 -0
- package/esm/components/Rows/StoryTemplates/LiveBlogStoryTemplates/index.js +97 -0
- package/esm/components/Rows/StoryTemplates/LiveBlogStoryTemplates/live-blog.m.css +326 -0
- package/esm/components/Rows/StoryTemplates/LiveBlogStoryTemplates/stories.js +118 -0
- package/esm/components/Rows/StoryTemplates/LiveBlogStoryTemplates/templates.js +418 -0
- package/esm/components/Rows/StoryTemplates/PhotoStoryTemplates/index.js +294 -0
- package/esm/components/Rows/StoryTemplates/PhotoStoryTemplates/photo-story.test.js +163 -0
- package/esm/components/Rows/StoryTemplates/PhotoStoryTemplates/photo.m.css +175 -0
- package/esm/components/Rows/StoryTemplates/PhotoStoryTemplates/stories.js +124 -0
- package/esm/components/Rows/StoryTemplates/TextStoryTemplates/README.md +49 -0
- package/esm/components/Rows/StoryTemplates/TextStoryTemplates/index.js +100 -0
- package/esm/components/Rows/StoryTemplates/TextStoryTemplates/stories.js +124 -0
- package/esm/components/Rows/StoryTemplates/TextStoryTemplates/templates.js +285 -0
- package/esm/components/Rows/StoryTemplates/TextStoryTemplates/text-story.m.css +449 -0
- package/esm/components/Rows/StoryTemplates/TextStoryTemplates/text-story.test.js +242 -0
- package/esm/components/Rows/StoryTemplates/VideoStoryTemplates/README.md +31 -0
- package/esm/components/Rows/StoryTemplates/VideoStoryTemplates/index.js +239 -0
- package/esm/components/Rows/StoryTemplates/VideoStoryTemplates/stories.js +214 -0
- package/esm/components/Rows/StoryTemplates/VideoStoryTemplates/video-story.m.css +195 -0
- package/esm/components/Rows/TagIntroductionCard/README.md +11 -0
- package/esm/components/Rows/TagIntroductionCard/index.js +45 -0
- package/esm/components/Rows/TagIntroductionCard/stories.js +20 -0
- package/esm/components/Rows/TagIntroductionCard/tag-intro-card.module.css +25 -0
- package/esm/components/Rows/ThreeColFlexStories/README.md +38 -0
- package/{atoms/ExtendedLoadMore/index-b5936059.js → esm/components/Rows/ThreeColFlexStories/index.js} +70 -74
- package/esm/components/Rows/ThreeColFlexStories/stories.js +74 -0
- package/esm/components/Rows/ThreeColFlexStories/three-col-flex-stories.m.css +60 -0
- package/esm/components/Rows/ThreeColFourteenStory/README.md +28 -0
- package/esm/components/Rows/ThreeColFourteenStory/index.js +154 -0
- package/esm/components/Rows/ThreeColFourteenStory/stories.js +65 -0
- package/esm/components/Rows/ThreeColFourteenStory/three-col-fourteen-story.m.css +51 -0
- package/esm/components/Rows/ThreeColGrid/README.md +36 -0
- package/{atoms/ExtendedLoadMore/index-6e083738.js → esm/components/Rows/ThreeColGrid/index.js} +55 -62
- package/esm/components/Rows/ThreeColGrid/stories.js +78 -0
- package/esm/components/Rows/ThreeColGrid/three-col.m.css +43 -0
- package/esm/components/Rows/ThreeColSevenStory/README.md +36 -0
- package/esm/components/Rows/ThreeColSevenStory/index.js +201 -0
- package/esm/components/Rows/ThreeColSevenStory/stories.js +74 -0
- package/esm/components/Rows/ThreeColSevenStory/three-col-seven-story.m.css +44 -0
- package/esm/components/Rows/ThreeColSixStories/README.md +40 -0
- package/esm/components/Rows/ThreeColSixStories/index.js +183 -0
- package/esm/components/Rows/ThreeColSixStories/stories.js +74 -0
- package/esm/components/Rows/ThreeColSixStories/three-col-six-stories.m.css +32 -0
- package/esm/components/Rows/ThreeColTwelveStories/README.md +41 -0
- package/esm/components/Rows/ThreeColTwelveStories/index.js +165 -0
- package/esm/components/Rows/ThreeColTwelveStories/stories.js +53 -0
- package/esm/components/Rows/ThreeColTwelveStories/three-col-twelve-stories.m.css +83 -0
- package/esm/components/Rows/TwoColFourStory/README.md +33 -0
- package/esm/components/Rows/TwoColFourStory/index.js +174 -0
- package/esm/components/Rows/TwoColFourStory/stories.js +63 -0
- package/esm/components/Rows/TwoColFourStory/two-col-four-story.m.css +64 -0
- package/esm/components/Rows/TwoColFourStoryHighlight/README.md +35 -0
- package/esm/components/Rows/TwoColFourStoryHighlight/index.js +164 -0
- package/esm/components/Rows/TwoColFourStoryHighlight/stories.js +50 -0
- package/esm/components/Rows/TwoColFourStoryHighlight/two-col-four-story-highlight.m.css +116 -0
- package/esm/components/Rows/TwoColSevenStories/README.md +37 -0
- package/esm/components/Rows/TwoColSevenStories/index.js +193 -0
- package/esm/components/Rows/TwoColSevenStories/stories.js +102 -0
- package/esm/components/Rows/TwoColSevenStories/two-col-seven-stories.m.css +175 -0
- package/esm/components/Rows/TwoColSixStories/README.md +36 -0
- package/esm/components/Rows/TwoColSixStories/index.js +185 -0
- package/esm/components/Rows/TwoColSixStories/stories.js +67 -0
- package/esm/components/Rows/TwoColSixStories/two-col-six-stories.m.css +135 -0
- package/esm/components/Rows/TwoColTenStoriesSidebar/README.md +34 -0
- package/esm/components/Rows/TwoColTenStoriesSidebar/index.js +191 -0
- package/esm/components/Rows/TwoColTenStoriesSidebar/stories.js +53 -0
- package/esm/components/Rows/TwoColTenStoriesSidebar/two-col-ten-stories-sidebar.m.css +52 -0
- package/esm/components/Rows/TwoColThreeStory/README.md +40 -0
- package/esm/components/Rows/TwoColThreeStory/index.js +146 -0
- package/esm/components/Rows/TwoColThreeStory/stories.js +63 -0
- package/esm/components/Rows/TwoColThreeStory/two-col-three-story.m.css +36 -0
- package/esm/components/SharedContext.js +17 -0
- package/esm/components/Svgs/Loading/loading.js +140 -0
- package/esm/components/Svgs/Loading/loading.m.css +5 -0
- package/esm/components/Svgs/SocialIcons/facebook.js +18 -0
- package/esm/components/Svgs/SocialIcons/instagram.js +33 -0
- package/esm/components/Svgs/SocialIcons/linkedin.js +18 -0
- package/esm/components/Svgs/SocialIcons/pinterest.js +12 -0
- package/esm/components/Svgs/SocialIcons/twitter.js +18 -0
- package/esm/components/Svgs/SocialIcons/whatsapp.js +19 -0
- package/esm/components/Svgs/SocialIcons/youtube.js +19 -0
- package/esm/components/Svgs/caret-right.svg +3 -0
- package/esm/components/Svgs/clock-icon.js +19 -0
- package/esm/components/Svgs/close-icon.js +22 -0
- package/esm/components/Svgs/crown.js +40 -0
- package/esm/components/Svgs/fallbackImage.js +45 -0
- package/esm/components/Svgs/hyperlink.js +22 -0
- package/esm/components/Svgs/key.js +39 -0
- package/esm/components/Svgs/left-arrow.js +24 -0
- package/esm/components/Svgs/liveicon.js +16 -0
- package/esm/components/Svgs/lock.js +40 -0
- package/esm/components/Svgs/right-arrow.js +24 -0
- package/esm/components/Svgs/share-icon.js +19 -0
- package/esm/components/Svgs/star.js +34 -0
- package/esm/components/Svgs/user-fallback-icon.js +22 -0
- package/esm/components/Typography/README.md +7 -0
- package/esm/components/Typography/index.js +33 -0
- package/esm/components/Typography/stories.js +15 -0
- package/esm/components/Typography/style.m.css +11 -0
- package/esm/entry-points.js +291 -0
- package/esm/guide/stories.js +22 -0
- package/esm/hydration-component/index.js +41 -0
- package/esm/hydration-component/useNearScreen.js +71 -0
- package/esm/index.js +88 -0
- package/esm/rows.js +40 -0
- package/esm/utils/testing-utils.js +8 -0
- package/esm/utils/utils.js +363 -0
- package/esm/utils/utils.test.js +46 -0
- package/package.json +1 -1
- package/atoms/Author/index.js +0 -2259
- package/atoms/Author/styles.arrow.css +0 -1
- package/atoms/AuthorWithTime/index.js +0 -2964
- package/atoms/AuthorWithTime/styles.arrow.css +0 -1
- package/atoms/CollectionName/index.js +0 -2344
- package/atoms/CollectionName/styles.arrow.css +0 -1
- package/atoms/ExtendedLoadMore/index-3c4ac692.js +0 -1025
- package/atoms/ExtendedLoadMore/index-4ddfe28d.js +0 -93
- package/atoms/ExtendedLoadMore/index-5c8eda4a.js +0 -358
- package/atoms/ExtendedLoadMore/index-9e0d32b7.js +0 -290
- package/atoms/ExtendedLoadMore/index-b22f1843.js +0 -251
- package/atoms/ExtendedLoadMore/index-e7cde739.js +0 -3051
- package/atoms/ExtendedLoadMore/index-fee73a14.js +0 -207
- package/atoms/ExtendedLoadMore/index.js +0 -13
- package/atoms/ExtendedLoadMore/styles.arrow.css +0 -1
- package/atoms/Headline/index.js +0 -2468
- package/atoms/Headline/styles.arrow.css +0 -1
- package/atoms/HeroImage/index.js +0 -2484
- package/atoms/HeroImage/styles.arrow.css +0 -1
- package/atoms/LoadmoreButton/index.js +0 -2277
- package/atoms/LoadmoreButton/styles.arrow.css +0 -1
- package/atoms/ScrollSnap/index.js +0 -2540
- package/atoms/ScrollSnap/styles.arrow.css +0 -1
- package/atoms/SectionTag/index.js +0 -2229
- package/atoms/SectionTag/styles.arrow.css +0 -1
- package/atoms/Subheadline/index.js +0 -2209
- package/atoms/Subheadline/styles.arrow.css +0 -1
- package/atoms/TimeStamp/index.js +0 -2671
- package/atoms/TimeStamp/styles.arrow.css +0 -1
- package/molecules/KeyEvents/index.js +0 -2979
- package/molecules/KeyEvents/styles.arrow.css +0 -1
- package/molecules/PageIntroductionCard/index.js +0 -2685
- package/molecules/PageIntroductionCard/styles.arrow.css +0 -1
- package/molecules/SocialShareTemplate/index.js +0 -3102
- package/molecules/SocialShareTemplate/styles.arrow.css +0 -1
- package/molecules/StoryCard/index.js +0 -3948
- package/molecules/StoryCard/styles.arrow.css +0 -1
- package/molecules/StoryElementCard/index.js +0 -5861
- package/molecules/StoryElementCard/styles.arrow.css +0 -1
- package/molecules/StorycardContent/index.js +0 -3426
- package/molecules/StorycardContent/styles.arrow.css +0 -1
- package/rows/AlternateCollectionFilter/index.js +0 -4756
- package/rows/AlternateCollectionFilter/styles.arrow.css +0 -1
- package/rows/AsideCollection/index.js +0 -4702
- package/rows/AsideCollection/styles.arrow.css +0 -1
- package/rows/AstrologyCollection/index.js +0 -4673
- package/rows/AstrologyCollection/styles.arrow.css +0 -1
- package/rows/AuthorIntroductionCard/index.js +0 -3529
- package/rows/AuthorIntroductionCard/styles.arrow.css +0 -1
- package/rows/AuthorsList/index.js +0 -3725
- package/rows/AuthorsList/styles.arrow.css +0 -1
- package/rows/CollectionFilter/index.js +0 -4846
- package/rows/CollectionFilter/styles.arrow.css +0 -1
- package/rows/ElevenStories/index.js +0 -4649
- package/rows/ElevenStories/styles.arrow.css +0 -1
- package/rows/FourColFiveStories/index.js +0 -4389
- package/rows/FourColFiveStories/styles.arrow.css +0 -1
- package/rows/FourColGrid/index.js +0 -4614
- package/rows/FourColGrid/styles.arrow.css +0 -1
- package/rows/FourColPortraitStories/index.js +0 -4647
- package/rows/FourColPortraitStories/styles.arrow.css +0 -1
- package/rows/FourColSixteenStories/index.js +0 -4386
- package/rows/FourColSixteenStories/styles.arrow.css +0 -1
- package/rows/FourColTwelveStories/index.js +0 -4346
- package/rows/FourColTwelveStories/styles.arrow.css +0 -1
- package/rows/FourStorySlider/index.js +0 -4754
- package/rows/FourStorySlider/styles.arrow.css +0 -1
- package/rows/FourStorySliderPortrait/index.js +0 -4757
- package/rows/FourStorySliderPortrait/styles.arrow.css +0 -1
- package/rows/FourTabbedBigStorySlider/index.js +0 -4516
- package/rows/FourTabbedBigStorySlider/styles.arrow.css +0 -1
- package/rows/FullScreenSlider/index.js +0 -4672
- package/rows/FullScreenSlider/styles.arrow.css +0 -1
- package/rows/HalfScreenSlider/index.js +0 -4525
- package/rows/HalfScreenSlider/styles.arrow.css +0 -1
- package/rows/ListComponent/index.js +0 -4473
- package/rows/ListComponent/styles.arrow.css +0 -1
- package/rows/Listicles/index.js +0 -3142
- package/rows/Listicles/styles.arrow.css +0 -1
- package/rows/MagazineEditions/index.js +0 -3153
- package/rows/MagazineEditions/styles.arrow.css +0 -1
- package/rows/MagazineHeaderCard/index.js +0 -3147
- package/rows/MagazineHeaderCard/styles.arrow.css +0 -1
- package/rows/MagazineWidget/index.js +0 -4525
- package/rows/MagazineWidget/styles.arrow.css +0 -1
- package/rows/OneColStoryList/index.js +0 -4700
- package/rows/OneColStoryList/styles.arrow.css +0 -1
- package/rows/OpinionCollection/index.js +0 -4067
- package/rows/OpinionCollection/styles.arrow.css +0 -1
- package/rows/SixColSixStories/index.js +0 -4545
- package/rows/SixColSixStories/styles.arrow.css +0 -1
- package/rows/StoryCollection/index.js +0 -4702
- package/rows/StoryCollection/styles.arrow.css +0 -1
- package/rows/TagIntroductionCard/index.js +0 -1910
- package/rows/TagIntroductionCard/styles.arrow.css +0 -1
- package/rows/ThreeColFlexStories/index.js +0 -4605
- package/rows/ThreeColFlexStories/styles.arrow.css +0 -1
- package/rows/ThreeColFourteenStories/index.js +0 -4294
- package/rows/ThreeColFourteenStories/styles.arrow.css +0 -1
- package/rows/ThreeColGrid/index.js +0 -4635
- package/rows/ThreeColGrid/styles.arrow.css +0 -1
- package/rows/ThreeColSevenStory/index.js +0 -4513
- package/rows/ThreeColSevenStory/styles.arrow.css +0 -1
- package/rows/ThreeColSixStories/index.js +0 -4496
- package/rows/ThreeColSixStories/styles.arrow.css +0 -1
- package/rows/ThreeColTwelveStories/index.js +0 -4391
- package/rows/ThreeColTwelveStories/styles.arrow.css +0 -1
- package/rows/TwoColFourStories/index.js +0 -4474
- package/rows/TwoColFourStories/styles.arrow.css +0 -1
- package/rows/TwoColFourStoryHighlight/index.js +0 -4467
- package/rows/TwoColFourStoryHighlight/styles.arrow.css +0 -1
- package/rows/TwoColSevenStories/index.js +0 -4501
- package/rows/TwoColSevenStories/styles.arrow.css +0 -1
- package/rows/TwoColSixStories/index.js +0 -4500
- package/rows/TwoColSixStories/styles.arrow.css +0 -1
- package/rows/TwoColTenStoriesSidebar/index.js +0 -4560
- package/rows/TwoColTenStoriesSidebar/styles.arrow.css +0 -1
- package/rows/TwoColThreeStories/index.js +0 -4447
- package/rows/TwoColThreeStories/styles.arrow.css +0 -1
- package/story-elements/AlsoRead/index.js +0 -2466
- package/story-elements/AlsoRead/styles.arrow.css +0 -1
- package/story-elements/Attachment/index.js +0 -2022
- package/story-elements/Attachment/styles.arrow.css +0 -1
- package/story-elements/BigFact/index.js +0 -1992
- package/story-elements/BigFact/styles.arrow.css +0 -1
- package/story-elements/BlockQuote/index.js +0 -2441
- package/story-elements/BlockQuote/styles.arrow.css +0 -1
- package/story-elements/Blurb/index.js +0 -2103
- package/story-elements/Blurb/styles.arrow.css +0 -1
- package/story-elements/Image/index.js +0 -2738
- package/story-elements/Image/styles.arrow.css +0 -1
- package/story-elements/ImageGallery/index.js +0 -2671
- package/story-elements/ImageGallery/styles.arrow.css +0 -1
- package/story-elements/ImageSlideshow/index.js +0 -2982
- package/story-elements/ImageSlideshow/styles.arrow.css +0 -1
- package/story-elements/QuestionAnswer/index.js +0 -2404
- package/story-elements/QuestionAnswer/styles.arrow.css +0 -1
- package/story-elements/Quote/index.js +0 -2021
- package/story-elements/Quote/styles.arrow.css +0 -1
- package/story-elements/Reference/index.js +0 -2015
- package/story-elements/Reference/styles.arrow.css +0 -1
- package/story-elements/StoryElement/index.js +0 -1788
- package/story-elements/Summary/index.js +0 -2045
- package/story-elements/Summary/styles.arrow.css +0 -1
- package/story-elements/Text/index.js +0 -2302
- package/story-elements/Text/styles.arrow.css +0 -1
- package/story-elements/Video/index.js +0 -1794
- package/story-elements/Video/styles.arrow.css +0 -1
- package/story-templates/ListicleStoryTemplate/index.js +0 -8471
- package/story-templates/ListicleStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/LiveBlogStoryTemplate/index.js +0 -8647
- package/story-templates/LiveBlogStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/PhotoStoryTemplate/index.js +0 -8449
- package/story-templates/PhotoStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/TextStoryTemplate/index.js +0 -8522
- package/story-templates/TextStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/VideoStoryTemplate/index.js +0 -8381
- package/story-templates/VideoStoryTemplate/styles.arrow.css +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import _getClassName from "babel-plugin-react-css-modules/dist/browser/getClassName";
|
|
2
|
+
import { get } from "lodash";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import PropTypes from "prop-types";
|
|
5
|
+
import { getTextColor } from "../../../utils/utils";
|
|
6
|
+
import { useStateValue } from "../../SharedContext";
|
|
7
|
+
import "./read-time.m.css";
|
|
8
|
+
import { Dot } from "../Dot/dot";
|
|
9
|
+
var _styleModuleImportMap = {
|
|
10
|
+
"./read-time.m.css": {
|
|
11
|
+
"read-time-wrapper": "read-time-m_read-time-wrapper__3GyC_",
|
|
12
|
+
"dot-indicator": "read-time-m_dot-indicator__3Sqh2",
|
|
13
|
+
"dark": "read-time-m_dark__3yRaK",
|
|
14
|
+
"light": "read-time-m_light__1GAZu"
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export var ReadTime = function ReadTime(_ref) {
|
|
18
|
+
var story = _ref.story,
|
|
19
|
+
_ref$opts = _ref.opts,
|
|
20
|
+
opts = _ref$opts === void 0 ? {} : _ref$opts,
|
|
21
|
+
_ref$isLightTheme = _ref.isLightTheme,
|
|
22
|
+
isLightTheme = _ref$isLightTheme === void 0 ? false : _ref$isLightTheme;
|
|
23
|
+
var config = useStateValue() || {};
|
|
24
|
+
var showReadTime = get(config, ["showReadTime"]) || get(opts, ["showReadTime"], true);
|
|
25
|
+
var readTime = get(story, ["read-time"], 0);
|
|
26
|
+
var textColor = isLightTheme ? "light" : getTextColor(config.theme);
|
|
27
|
+
if (!showReadTime || !readTime) return null;
|
|
28
|
+
var timeToRead = get(opts, ["localizedTimeToRead"]) || "min read";
|
|
29
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
"data-test-id": "read-time",
|
|
31
|
+
className: "arrow-component arr--read-time " + _getClassName("read-time-wrapper ".concat(textColor), _styleModuleImportMap)
|
|
32
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
33
|
+
className: "read-time-indicator read-time-m_dot-indicator__3Sqh2"
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Dot, {
|
|
35
|
+
color: textColor
|
|
36
|
+
})), /*#__PURE__*/React.createElement("span", null, readTime, " ", timeToRead)));
|
|
37
|
+
};
|
|
38
|
+
ReadTime.propTypes = {
|
|
39
|
+
story: PropTypes.shape({
|
|
40
|
+
"read-time": PropTypes.number
|
|
41
|
+
}),
|
|
42
|
+
opts: PropTypes.shape({
|
|
43
|
+
showReadTime: PropTypes.bool
|
|
44
|
+
}),
|
|
45
|
+
isLightTheme: PropTypes.bool
|
|
46
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@custom-media --viewport-medium (width >= 768px);
|
|
2
|
+
|
|
3
|
+
.read-time-wrapper {
|
|
4
|
+
display: flex;
|
|
5
|
+
font-size: var(--arrow-fs-tiny);
|
|
6
|
+
line-height: var(--arrow-lh-2);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.dot-indicator {
|
|
10
|
+
padding: 0 var(--arrow-spacing-xs) var(--arrow-spacing-xs);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.dark {
|
|
14
|
+
color: var(--arrow-c-mono4);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.light {
|
|
18
|
+
color: var(--arrow-c-invert-mono4);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
html[dir="rtl"] {
|
|
22
|
+
.read-time-wrapper {
|
|
23
|
+
margin-right: var(--arrow-spacing-xs);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { mount } from "enzyme";
|
|
3
|
+
import expect from "expect";
|
|
4
|
+
import { generateStory } from "../../Fixture/index";
|
|
5
|
+
import { ReadTime } from "./index";
|
|
6
|
+
var story = generateStory();
|
|
7
|
+
describe("Read time", function () {
|
|
8
|
+
it("Should render read time component", function () {
|
|
9
|
+
var wrapper = mount( /*#__PURE__*/React.createElement(ReadTime, {
|
|
10
|
+
story: story,
|
|
11
|
+
opts: {
|
|
12
|
+
showReadTime: true
|
|
13
|
+
}
|
|
14
|
+
}));
|
|
15
|
+
expect(wrapper.find({
|
|
16
|
+
"data-test-id": "read-time"
|
|
17
|
+
}).prop("className")).toMatch(/read-time-wrapper/);
|
|
18
|
+
});
|
|
19
|
+
it("Should not render read time if showReadTime is false", function () {
|
|
20
|
+
var wrapper = mount( /*#__PURE__*/React.createElement(ReadTime, {
|
|
21
|
+
opts: {
|
|
22
|
+
showReadTime: false
|
|
23
|
+
}
|
|
24
|
+
}));
|
|
25
|
+
expect(wrapper.find({
|
|
26
|
+
"data-test-id": "read-time"
|
|
27
|
+
}).length).toEqual(0);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { generateStory } from "../../Fixture";
|
|
3
|
+
import { withStore } from "../../../../storybook";
|
|
4
|
+
import { ReadTime } from "./index";
|
|
5
|
+
import Readme from "./README.md";
|
|
6
|
+
import { boolean as _boolean } from "@storybook/addon-knobs";
|
|
7
|
+
var story = generateStory();
|
|
8
|
+
withStore("Atoms/Read Time", {}, Readme).add("default", function () {
|
|
9
|
+
return /*#__PURE__*/React.createElement(ReadTime, {
|
|
10
|
+
story: story,
|
|
11
|
+
opts: {
|
|
12
|
+
showReadTime: _boolean("Show Read Time", true)
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import _getClassName from "babel-plugin-react-css-modules/dist/browser/getClassName";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { number, string, func } from "prop-types";
|
|
4
|
+
import { getTextColor } from "../../../../utils/utils";
|
|
5
|
+
import { LeftArrow } from "../../../Svgs/left-arrow";
|
|
6
|
+
import { RightArrow } from "../../../Svgs/right-arrow";
|
|
7
|
+
import { useStateValue } from "../../../SharedContext";
|
|
8
|
+
import "./slider-arrow.m.css";
|
|
9
|
+
var _styleModuleImportMap = {
|
|
10
|
+
"./slider-arrow.m.css": {
|
|
11
|
+
"arrow": "slider-arrow-m_arrow__1eBUU",
|
|
12
|
+
"left-arrow-dark": "slider-arrow-m_left-arrow-dark__3mTJS",
|
|
13
|
+
"right-arrow-dark": "slider-arrow-m_right-arrow-dark__3hWZe",
|
|
14
|
+
"left-arrow-light": "slider-arrow-m_left-arrow-light__2ipUK",
|
|
15
|
+
"right-arrow-light": "slider-arrow-m_right-arrow-light__3omMU",
|
|
16
|
+
"left-arrow-ltr": "slider-arrow-m_left-arrow-ltr__1ngNF",
|
|
17
|
+
"right-arrow-ltr": "slider-arrow-m_right-arrow-ltr__2svWX",
|
|
18
|
+
"left-arrow-rtl": "slider-arrow-m_left-arrow-rtl__2ynyn",
|
|
19
|
+
"right-arrow-rtl": "slider-arrow-m_right-arrow-rtl__1GjPz"
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export var SliderArrow = function SliderArrow(_ref) {
|
|
23
|
+
var selectedIndex = _ref.selectedIndex,
|
|
24
|
+
previousClick = _ref.previousClick,
|
|
25
|
+
nextClick = _ref.nextClick,
|
|
26
|
+
noOfItems = _ref.noOfItems,
|
|
27
|
+
perView = _ref.perView,
|
|
28
|
+
languageDirection = _ref.languageDirection;
|
|
29
|
+
|
|
30
|
+
if (noOfItems < 1) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
var config = useStateValue() || {};
|
|
35
|
+
var textColor = getTextColor(config.theme);
|
|
36
|
+
|
|
37
|
+
var rightArrowView = function rightArrowView() {
|
|
38
|
+
if (selectedIndex >= noOfItems - perView) return false;
|
|
39
|
+
return true;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var getLeftArrowClassName = languageDirection === "rtl" ? "left-arrow-rtl" : "left-arrow-ltr";
|
|
43
|
+
var getRightArrowClassName = languageDirection === "rtl" ? "right-arrow-rtl" : "right-arrow-ltr";
|
|
44
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, selectedIndex !== 0 ? /*#__PURE__*/React.createElement("button", {
|
|
45
|
+
onClick: previousClick,
|
|
46
|
+
className: ("left-arrow ".concat(getLeftArrowClassName) ? "left-arrow ".concat(getLeftArrowClassName) + " " : "") + _getClassName("arrow left-arrow-".concat(textColor, " ").concat(getLeftArrowClassName), _styleModuleImportMap)
|
|
47
|
+
}, /*#__PURE__*/React.createElement(LeftArrow, {
|
|
48
|
+
color: textColor === "dark" ? "#fff" : "#333"
|
|
49
|
+
})) : null, selectedIndex < noOfItems - 1 && rightArrowView() ? /*#__PURE__*/React.createElement("button", {
|
|
50
|
+
onClick: nextClick,
|
|
51
|
+
className: ("right-arrow ".concat(getRightArrowClassName) ? "right-arrow ".concat(getRightArrowClassName) + " " : "") + _getClassName("arrow right-arrow-".concat(textColor, " ").concat(getRightArrowClassName), _styleModuleImportMap)
|
|
52
|
+
}, /*#__PURE__*/React.createElement(RightArrow, {
|
|
53
|
+
color: textColor === "dark" ? "#fff" : "#333"
|
|
54
|
+
})) : null);
|
|
55
|
+
};
|
|
56
|
+
SliderArrow.propTypes = {
|
|
57
|
+
noOfItems: number,
|
|
58
|
+
perView: number,
|
|
59
|
+
slideIndicator: string,
|
|
60
|
+
previousClick: func,
|
|
61
|
+
nextClick: func,
|
|
62
|
+
selectedIndex: number,
|
|
63
|
+
languageDirection: string
|
|
64
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
.arrow {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 50%;
|
|
4
|
+
transform: translateY(-50%);
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
background-color: var(--arrow-c-light);
|
|
7
|
+
opacity: 0.8;
|
|
8
|
+
padding: var(--arrow-spacing-l) var(--arrow-spacing-s);
|
|
9
|
+
border: none;
|
|
10
|
+
border-radius: 0;
|
|
11
|
+
@media only screen and (max-width: 767px) {
|
|
12
|
+
top: calc(25% + 40px);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.left-arrow-dark,
|
|
17
|
+
.right-arrow-dark {
|
|
18
|
+
background-color: var(--arrow-c-dark);
|
|
19
|
+
}
|
|
20
|
+
.left-arrow-light,
|
|
21
|
+
.right-arrow-light {
|
|
22
|
+
background-color: var(--arrow-c-light);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.left-arrow-ltr {
|
|
26
|
+
left: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.right-arrow-ltr {
|
|
30
|
+
right: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.left-arrow-rtl {
|
|
34
|
+
right: 0;
|
|
35
|
+
left: unset;
|
|
36
|
+
}
|
|
37
|
+
.left-arrow-rtl svg,
|
|
38
|
+
.right-arrow-rtl svg {
|
|
39
|
+
transform: rotate(180deg);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.right-arrow-rtl {
|
|
43
|
+
left: 0;
|
|
44
|
+
right: unset;
|
|
45
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _getClassName from "babel-plugin-react-css-modules/dist/browser/getClassName";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { array, number, string, func } from "prop-types";
|
|
4
|
+
import { getTextColor } from "../../../../utils/utils";
|
|
5
|
+
import { useStateValue } from "../../../SharedContext";
|
|
6
|
+
import "./slider-indicator.m.css";
|
|
7
|
+
var _styleModuleImportMap = {
|
|
8
|
+
"./slider-indicator.m.css": {
|
|
9
|
+
"indicators": "slider-indicator-m_indicators__3MNXc",
|
|
10
|
+
"indicator": "slider-indicator-m_indicator__gTv3x",
|
|
11
|
+
"indicator-button": "slider-indicator-m_indicator-button__1e82r",
|
|
12
|
+
"indicator-dots": "slider-indicator-m_indicator-dots__2TR3H",
|
|
13
|
+
"indicator-dots-dark": "slider-indicator-m_indicator-dots-dark__sGrev",
|
|
14
|
+
"indicator-dots-light": "slider-indicator-m_indicator-dots-light__2nPn-",
|
|
15
|
+
"indicator-dashes": "slider-indicator-m_indicator-dashes__DyNCE",
|
|
16
|
+
"indicator-dashes-dark": "slider-indicator-m_indicator-dashes-dark__VrqJI",
|
|
17
|
+
"indicator-dashes-light": "slider-indicator-m_indicator-dashes-light__34ESx"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export var SliderIndicator = function SliderIndicator(_ref) {
|
|
21
|
+
var indicatorItems = _ref.indicatorItems,
|
|
22
|
+
indicatorClick = _ref.indicatorClick,
|
|
23
|
+
selectedIndex = _ref.selectedIndex,
|
|
24
|
+
indicatorType = _ref.indicatorType;
|
|
25
|
+
|
|
26
|
+
if (indicatorItems.length < 1) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var config = useStateValue() || {};
|
|
31
|
+
var textColor = getTextColor(config.theme);
|
|
32
|
+
return /*#__PURE__*/React.createElement("ul", {
|
|
33
|
+
className: "slider-indicators slider-indicator-m_indicators__3MNXc"
|
|
34
|
+
}, indicatorItems.map(function (_, index) {
|
|
35
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
36
|
+
key: "slider-".concat(index),
|
|
37
|
+
className: "indicator slider-indicator-m_indicator__gTv3x",
|
|
38
|
+
onClick: function onClick(e) {
|
|
39
|
+
return indicatorClick(e, index);
|
|
40
|
+
}
|
|
41
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
42
|
+
"aria-pressed": selectedIndex === index ? "true" : "false",
|
|
43
|
+
className: ("indicator-button indicator-".concat(indicatorType) ? "indicator-button indicator-".concat(indicatorType) + " " : "") + _getClassName("indicator-button indicator-".concat(indicatorType, " indicator-").concat(indicatorType, "-").concat(textColor), _styleModuleImportMap)
|
|
44
|
+
}));
|
|
45
|
+
}));
|
|
46
|
+
};
|
|
47
|
+
SliderIndicator.propTypes = {
|
|
48
|
+
indicatorItems: array,
|
|
49
|
+
perView: number,
|
|
50
|
+
indicatorType: string,
|
|
51
|
+
indicatorClick: func,
|
|
52
|
+
selectedIndex: number
|
|
53
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
.indicators {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: center;
|
|
4
|
+
width: 100%;
|
|
5
|
+
list-style: none;
|
|
6
|
+
font-family: var(--arrow-typeface-secondary);
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
line-height: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.indicator {
|
|
12
|
+
margin: var(--arrow-spacing-xs) 0;
|
|
13
|
+
padding: 4px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.indicator-button {
|
|
17
|
+
background: none;
|
|
18
|
+
border: none;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
padding: var(--arrow-spacing-s) var(--arrow-spacing-xxs);
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.indicator-dots {
|
|
25
|
+
width: 8px;
|
|
26
|
+
height: 8px;
|
|
27
|
+
border-radius: 50%;
|
|
28
|
+
background-color: var(--arrow-c-dark);
|
|
29
|
+
border: 1px solid var(--arrow-c-dark);
|
|
30
|
+
padding: 0;
|
|
31
|
+
opacity: 0.25;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.indicator-dots-dark[aria-pressed="true"] {
|
|
35
|
+
background-color: var(--arrow-c-dark);
|
|
36
|
+
opacity: 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.indicator-dots-light {
|
|
40
|
+
background-color: var(--arrow-c-light);
|
|
41
|
+
border-color: var(--arrow-c-light);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.indicator-dots-light[aria-pressed="true"] {
|
|
45
|
+
background-color: var(--arrow-c-light);
|
|
46
|
+
opacity: 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.indicator-dashes {
|
|
50
|
+
display: inline-block;
|
|
51
|
+
width: var(--arrow-spacing-s);
|
|
52
|
+
height: 2px;
|
|
53
|
+
padding: 0;
|
|
54
|
+
}
|
|
55
|
+
.indicator-dashes-dark {
|
|
56
|
+
opacity: 0.25;
|
|
57
|
+
background-color: var(--arrow-c-dark);
|
|
58
|
+
}
|
|
59
|
+
.indicator-dashes-light {
|
|
60
|
+
opacity: 0.25;
|
|
61
|
+
background-color: var(--arrow-c-light);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.indicator-dashes-dark[aria-pressed="true"] {
|
|
65
|
+
background-color: var(--arrow-c-dark);
|
|
66
|
+
opacity: 1;
|
|
67
|
+
}
|
|
68
|
+
.indicator-dashes-light[aria-pressed="true"] {
|
|
69
|
+
background-color: var(--arrow-c-light);
|
|
70
|
+
opacity: 1;
|
|
71
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import React, { useEffect, useState, useRef } from "react";
|
|
4
|
+
import { useSelector } from "react-redux";
|
|
5
|
+
import { array, number, bool, string } from "prop-types";
|
|
6
|
+
import { get } from "lodash";
|
|
7
|
+
import { SliderArrow } from "./SliderArrow";
|
|
8
|
+
import { SliderIndicator } from "./SliderIndicator";
|
|
9
|
+
import "./scroll-snap.m.css";
|
|
10
|
+
|
|
11
|
+
var smoothScroll = function smoothScroll(node, topOrLeft, horizontal) {
|
|
12
|
+
var _node$scrollTo;
|
|
13
|
+
|
|
14
|
+
node.scrollTo((_node$scrollTo = {}, _defineProperty(_node$scrollTo, horizontal ? "left" : "top", topOrLeft), _defineProperty(_node$scrollTo, "behavior", "smooth"), _node$scrollTo));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var updateItemSelection = function updateItemSelection(index, languageDirection, scroller, noOfItems) {
|
|
18
|
+
var getScrollValue = Math.floor(scroller.current.scrollWidth * (index / noOfItems));
|
|
19
|
+
var scrollValue = languageDirection === "rtl" ? getScrollValue * -1 : getScrollValue;
|
|
20
|
+
smoothScroll(scroller.current, scrollValue, true);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var setIndicatorValue = function setIndicatorValue(func, ms) {
|
|
24
|
+
var timeout;
|
|
25
|
+
return function () {
|
|
26
|
+
clearTimeout(timeout);
|
|
27
|
+
timeout = setTimeout(function () {
|
|
28
|
+
timeout = null;
|
|
29
|
+
func();
|
|
30
|
+
}, ms);
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export var ScrollSnap = function ScrollSnap(_ref) {
|
|
35
|
+
var children = _ref.children,
|
|
36
|
+
isArrow = _ref.isArrow,
|
|
37
|
+
interval = _ref.interval,
|
|
38
|
+
isInfinite = _ref.isInfinite,
|
|
39
|
+
pauseOnHover = _ref.pauseOnHover,
|
|
40
|
+
perView = _ref.perView,
|
|
41
|
+
slideIndicator = _ref.slideIndicator;
|
|
42
|
+
|
|
43
|
+
var _useState = useState(0),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
selectedIndex = _useState2[0],
|
|
46
|
+
setSelectedIndex = _useState2[1];
|
|
47
|
+
|
|
48
|
+
var _useState3 = useState(false),
|
|
49
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
50
|
+
autoScroll = _useState4[0],
|
|
51
|
+
setAutoScroll = _useState4[1];
|
|
52
|
+
|
|
53
|
+
var languageDirection = useSelector(function (state) {
|
|
54
|
+
return get(state, ["qt", "config", "language", "direction"], "ltr");
|
|
55
|
+
});
|
|
56
|
+
var noOfItems = children ? children.length : 0;
|
|
57
|
+
var scroller = useRef(null);
|
|
58
|
+
var numberOfIndicatorsToShow = children.length - (perView - 1);
|
|
59
|
+
var indicatorItems = children.slice(0, numberOfIndicatorsToShow);
|
|
60
|
+
useEffect(function () {
|
|
61
|
+
if (scroller.current) {
|
|
62
|
+
scroller.current.addEventListener("scroll", setIndicatorValue(function () {
|
|
63
|
+
var value = Math.round(scroller.current.scrollLeft / scroller.current.scrollWidth * noOfItems);
|
|
64
|
+
setSelectedIndex(Math.abs(value));
|
|
65
|
+
}, 150)); // For Default Selection if selectedIndex is not 0 then manually select it
|
|
66
|
+
|
|
67
|
+
if (selectedIndex !== 0) {
|
|
68
|
+
updateItemSelection(selectedIndex);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return function () {
|
|
73
|
+
scroller.current.removeEventListener("scroll", setIndicatorValue);
|
|
74
|
+
};
|
|
75
|
+
}, []); // Infinite scroll
|
|
76
|
+
|
|
77
|
+
useEffect(function () {
|
|
78
|
+
if (isInfinite && !autoScroll) {
|
|
79
|
+
var timer = setInterval(function () {
|
|
80
|
+
infiniteScroll();
|
|
81
|
+
}, interval);
|
|
82
|
+
return function () {
|
|
83
|
+
clearInterval(timer);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}, [isInfinite, autoScroll]);
|
|
87
|
+
|
|
88
|
+
var infiniteScroll = function infiniteScroll() {
|
|
89
|
+
setSelectedIndex(function (value) {
|
|
90
|
+
var newIndex = value === noOfItems - perView ? 0 : value + 1;
|
|
91
|
+
updateItemSelection(newIndex, languageDirection, scroller, noOfItems);
|
|
92
|
+
return newIndex;
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
var pauseAutoPlay = function pauseAutoPlay() {
|
|
97
|
+
pauseOnHover && setAutoScroll(!autoScroll);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
var indicatorClick = function indicatorClick(e, newIndex) {
|
|
101
|
+
e.preventDefault();
|
|
102
|
+
e.stopPropagation();
|
|
103
|
+
setSelectedIndex(newIndex);
|
|
104
|
+
updateItemSelection(newIndex, languageDirection, scroller, noOfItems);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
var nextClick = function nextClick(e) {
|
|
108
|
+
e.preventDefault();
|
|
109
|
+
e.stopPropagation();
|
|
110
|
+
|
|
111
|
+
if (selectedIndex < noOfItems) {
|
|
112
|
+
var newIndex = selectedIndex + 1;
|
|
113
|
+
setSelectedIndex(newIndex);
|
|
114
|
+
updateItemSelection(newIndex, languageDirection, scroller, noOfItems);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
var previousClick = function previousClick(e) {
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
e.stopPropagation();
|
|
121
|
+
var newIndex = selectedIndex - 1;
|
|
122
|
+
setSelectedIndex(newIndex);
|
|
123
|
+
updateItemSelection(newIndex, languageDirection, scroller, noOfItems);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
127
|
+
className: "scroll-snap-container"
|
|
128
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
129
|
+
className: "scroll-snap-wrapper scroll-snap-m_wrapper__1Rz9v",
|
|
130
|
+
onMouseEnter: pauseAutoPlay,
|
|
131
|
+
onMouseLeave: pauseAutoPlay
|
|
132
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
133
|
+
ref: scroller,
|
|
134
|
+
className: "scroll-snap-carousel scroll-snap-m_carousel__2m3cg"
|
|
135
|
+
}, children), isArrow && /*#__PURE__*/React.createElement(SliderArrow, {
|
|
136
|
+
noOfItems: noOfItems,
|
|
137
|
+
perView: perView,
|
|
138
|
+
previousClick: previousClick,
|
|
139
|
+
nextClick: nextClick,
|
|
140
|
+
selectedIndex: selectedIndex,
|
|
141
|
+
languageDirection: languageDirection
|
|
142
|
+
})), children.length > perView && slideIndicator !== "none" && /*#__PURE__*/React.createElement(SliderIndicator, {
|
|
143
|
+
indicatorItems: indicatorItems,
|
|
144
|
+
indicatorClick: indicatorClick,
|
|
145
|
+
selectedIndex: selectedIndex,
|
|
146
|
+
indicatorType: slideIndicator
|
|
147
|
+
}));
|
|
148
|
+
};
|
|
149
|
+
ScrollSnap.defaultProps = {
|
|
150
|
+
isArrow: true,
|
|
151
|
+
isInfinite: false,
|
|
152
|
+
interval: 4000,
|
|
153
|
+
pauseOnHover: true,
|
|
154
|
+
perView: 1,
|
|
155
|
+
slideIndicator: "dots"
|
|
156
|
+
};
|
|
157
|
+
ScrollSnap.propTypes = {
|
|
158
|
+
children: array.isRequired,
|
|
159
|
+
isArrow: bool,
|
|
160
|
+
isInfinite: bool,
|
|
161
|
+
interval: number,
|
|
162
|
+
pauseOnHover: bool,
|
|
163
|
+
perView: number,
|
|
164
|
+
slideIndicator: string
|
|
165
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.wrapper {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.carousel {
|
|
6
|
+
display: flex;
|
|
7
|
+
overflow: auto;
|
|
8
|
+
scroll-snap-type: x mandatory;
|
|
9
|
+
-ms-overflow-style: none;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
|
|
12
|
+
> div {
|
|
13
|
+
scroll-snap-align: start;
|
|
14
|
+
flex-shrink: 0;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.carousel::-webkit-scrollbar {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.carousel::-moz-scrollbar {
|
|
26
|
+
overflow: -moz-scrollbars-none;
|
|
27
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import _getClassName from "babel-plugin-react-css-modules/dist/browser/getClassName";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { get } from "lodash";
|
|
4
|
+
import { Link } from "@quintype/components";
|
|
5
|
+
import { useStateValue } from "../../SharedContext";
|
|
6
|
+
import PropTypes from "prop-types";
|
|
7
|
+
import { getTextColor, rgbToHex } from "../../../utils/utils";
|
|
8
|
+
import "./section.m.css";
|
|
9
|
+
var _styleModuleImportMap = {
|
|
10
|
+
"./section.m.css": {
|
|
11
|
+
"section": "section-m_section__2N4S3",
|
|
12
|
+
"section-borderBottomSml": "section-m_section-borderBottomSml__2GNbo",
|
|
13
|
+
"border-bottom": "section-m_border-bottom__3cRoD",
|
|
14
|
+
"section-borderLeft": "section-m_section-borderLeft__3hKVj",
|
|
15
|
+
"border-left": "section-m_border-left__2oUyp",
|
|
16
|
+
"section-solid": "section-m_section-solid__1vB1Q",
|
|
17
|
+
"dark": "section-m_dark__1r3C4",
|
|
18
|
+
"light": "section-m_light__306hW"
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export var SectionTag = function SectionTag(_ref) {
|
|
22
|
+
var story = _ref.story,
|
|
23
|
+
_ref$template = _ref.template,
|
|
24
|
+
template = _ref$template === void 0 ? "" : _ref$template,
|
|
25
|
+
_ref$borderColor = _ref.borderColor,
|
|
26
|
+
borderColor = _ref$borderColor === void 0 ? "" : _ref$borderColor,
|
|
27
|
+
isLightTheme = _ref.isLightTheme;
|
|
28
|
+
var config = useStateValue() || {};
|
|
29
|
+
var isSection = get(config, ["showSection"], true);
|
|
30
|
+
var templateFromRowContext = get(config, ["sectionTagTemplate"]);
|
|
31
|
+
var section = get(story, ["sections", 0], "");
|
|
32
|
+
var supportedTemplates = ["borderBottomSml", "borderLeft", "solid"];
|
|
33
|
+
var getUrl = section ? section["section-url"] : "/";
|
|
34
|
+
var colorToApplyContrast = template === "solid" || templateFromRowContext === "solid" ? borderColor : config.theme;
|
|
35
|
+
var textColor = isLightTheme ? "light" : getTextColor(colorToApplyContrast);
|
|
36
|
+
var sectionTagBorderColor = rgbToHex(borderColor);
|
|
37
|
+
var templateStyle = supportedTemplates.includes(template) ? "section section-".concat(template) : "section";
|
|
38
|
+
|
|
39
|
+
if (templateFromRowContext) {
|
|
40
|
+
templateStyle = supportedTemplates.includes(templateFromRowContext) ? "section section-".concat(templateFromRowContext) : "section";
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (!isSection) return null;
|
|
44
|
+
return /*#__PURE__*/React.createElement(Link, {
|
|
45
|
+
href: getUrl,
|
|
46
|
+
className: "arrow-component arr--section-name",
|
|
47
|
+
"aria-label": "section-name"
|
|
48
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
"data-test-id": "sectionTag",
|
|
50
|
+
style: {
|
|
51
|
+
backgroundColor: templateStyle.includes("section-solid") ? sectionTagBorderColor : ""
|
|
52
|
+
},
|
|
53
|
+
className: "section-tag arrow-component " + _getClassName("".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap)
|
|
54
|
+
}, templateStyle.includes("section-borderLeft") && /*#__PURE__*/React.createElement("span", {
|
|
55
|
+
className: "section-m_border-left__2oUyp",
|
|
56
|
+
style: {
|
|
57
|
+
color: sectionTagBorderColor
|
|
58
|
+
}
|
|
59
|
+
}), section["display-name"] || section["name"], /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
className: "section-m_border-bottom__3cRoD",
|
|
61
|
+
style: {
|
|
62
|
+
backgroundColor: "".concat(template === "solid" ? "" : sectionTagBorderColor)
|
|
63
|
+
}
|
|
64
|
+
})));
|
|
65
|
+
};
|
|
66
|
+
SectionTag.propTypes = {
|
|
67
|
+
/** The Story Object from the API response */
|
|
68
|
+
story: PropTypes.object.isRequired,
|
|
69
|
+
|
|
70
|
+
/** The style template for section tag */
|
|
71
|
+
template: PropTypes.oneOf(["", "borderBottomSml", "borderLeft", "solid"]),
|
|
72
|
+
borderColor: PropTypes.string,
|
|
73
|
+
solidBorderColor: PropTypes.string,
|
|
74
|
+
isLightTheme: PropTypes.bool
|
|
75
|
+
};
|
|
76
|
+
SectionTag.defaultProps = {
|
|
77
|
+
template: "",
|
|
78
|
+
isLightTheme: false
|
|
79
|
+
};
|