@quintype/arrow 3.0.0-spike-skeleton-layout.21 → 3.0.0
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/.babelrc +12 -0
- package/.circleci/config.yml +42 -0
- package/.eslintrc.json +25 -0
- package/.prettierrc +6 -0
- package/.storybook/addons.js +5 -0
- package/.storybook/config.js +13 -0
- package/.storybook/webpack.config.js +8 -0
- package/.stylelintrc +10 -0
- package/.vscode/extensions.json +16 -0
- package/.vscode/settings.json +12 -0
- package/CHANGELOG.md +1362 -0
- package/README.md +10 -0
- package/__mocks__/fileMock.js +1 -0
- package/__mocks__/styleMock.js +1 -0
- package/{app.scss → assets/stylesheets/app.scss} +154 -1
- package/assets/stylesheets/mixins.scss +27 -0
- package/assets/stylesheets/reset.scss +148 -0
- package/assets/stylesheets/viewports.m.css +3 -0
- package/bin-dev-scripts/prepublish.sh +11 -0
- package/bin-dev-scripts/sync-to.sh +13 -0
- package/jest.config.json +14 -0
- package/package.json +131 -1
- package/publish +24 -0
- package/rollup.js +202 -0
- package/setupTests.js +3 -0
- package/src/components/Atoms/AdPlaceholder/ads.m.css +13 -0
- package/src/components/Atoms/AdPlaceholder/index.js +25 -0
- package/src/components/Atoms/Author/README.md +19 -0
- package/src/components/Atoms/Author/author.m.css +65 -0
- package/src/components/Atoms/Author/index.js +98 -0
- package/src/components/Atoms/Author/stories.js +23 -0
- package/src/components/Atoms/AuthorCard/README.md +47 -0
- package/src/components/Atoms/AuthorCard/author-card.m.css +174 -0
- package/src/components/Atoms/AuthorCard/author-card.test.js +72 -0
- package/src/components/Atoms/AuthorCard/index.js +115 -0
- package/src/components/Atoms/AuthorCard/stories.js +69 -0
- package/src/components/Atoms/AuthorImage/README.md +31 -0
- package/src/components/Atoms/AuthorImage/author-image.m.css +53 -0
- package/src/components/Atoms/AuthorImage/index.js +55 -0
- package/src/components/Atoms/AuthorImage/stories.js +20 -0
- package/src/components/Atoms/AuthorWithTimestamp/README.md +11 -0
- package/src/components/Atoms/AuthorWithTimestamp/author-with-timestamp.m.css +42 -0
- package/src/components/Atoms/AuthorWithTimestamp/index.js +79 -0
- package/src/components/Atoms/AuthorWithTimestamp/stories.js +21 -0
- package/src/components/Atoms/BulletPoint/README.md +9 -0
- package/src/components/Atoms/BulletPoint/bullet-point.m.css +14 -0
- package/src/components/Atoms/BulletPoint/index.js +19 -0
- package/src/components/Atoms/BulletPoint/stories.js +6 -0
- package/src/components/Atoms/CaptionAttribution/README.md +15 -0
- package/src/components/Atoms/CaptionAttribution/caption-attribution.m.css +40 -0
- package/src/components/Atoms/CaptionAttribution/caption-attribution.test.js +29 -0
- package/src/components/Atoms/CaptionAttribution/index.js +40 -0
- package/src/components/Atoms/CaptionAttribution/stories.js +40 -0
- package/src/components/Atoms/CollectionName/README.md +11 -0
- package/src/components/Atoms/CollectionName/collection-name.m.css +94 -0
- package/src/components/Atoms/CollectionName/index.js +143 -0
- package/src/components/Atoms/CollectionName/stories.js +52 -0
- package/src/components/Atoms/Divider/__snapshots__/divider.test.js.snap +18 -0
- package/src/components/Atoms/Divider/divider.m.css +6 -0
- package/src/components/Atoms/Divider/divider.test.js +10 -0
- package/src/components/Atoms/Divider/index.js +20 -0
- package/src/components/Atoms/Dot/dot.js +20 -0
- package/src/components/Atoms/Dot/dot.m.css +6 -0
- package/src/components/Atoms/ExtendedLoadMore/README.md +9 -0
- package/src/components/Atoms/ExtendedLoadMore/__snapshots__/extended-load-more.test.js.snap +11 -0
- package/src/components/Atoms/ExtendedLoadMore/extended-load-more.test.js +19 -0
- package/src/components/Atoms/ExtendedLoadMore/index.js +112 -0
- package/src/components/Atoms/FallbackImage/fallback.m.css +33 -0
- package/src/components/Atoms/FallbackImage/index.js +30 -0
- package/src/components/Atoms/Headline/README.md +7 -0
- package/src/components/Atoms/Headline/headline.m.css +26 -0
- package/src/components/Atoms/Headline/index.js +76 -0
- package/src/components/Atoms/Headline/stories.js +52 -0
- package/src/components/Atoms/HeroImage/README.md +13 -0
- package/src/components/Atoms/HeroImage/hero-image.m.css +71 -0
- package/src/components/Atoms/HeroImage/index.js +165 -0
- package/src/components/Atoms/HeroImage/stories.js +22 -0
- package/src/components/Atoms/LoadMoreTarget/index.js +24 -0
- package/src/components/Atoms/Loadmore/README.md +0 -0
- package/src/components/Atoms/Loadmore/__snapshots__/load-more.test.js.snap +25 -0
- package/src/components/Atoms/Loadmore/index.js +41 -0
- package/src/components/Atoms/Loadmore/load-more.m.css +23 -0
- package/src/components/Atoms/Loadmore/load-more.test.js +30 -0
- package/src/components/Atoms/Loadmore/stories.js +17 -0
- package/src/components/Atoms/MagazineCoverImage/README.md +21 -0
- package/src/components/Atoms/MagazineCoverImage/index.js +61 -0
- package/src/components/Atoms/MagazineCoverImage/magazine-cover-image.m.css +24 -0
- package/src/components/Atoms/MagazineCoverImage/stories.js +21 -0
- package/src/components/Atoms/PremiumStoryIcon/index.js +27 -0
- package/src/components/Atoms/PublishDetail/README.md +15 -0
- package/src/components/Atoms/PublishDetail/index.js +63 -0
- package/src/components/Atoms/PublishDetail/publish-details.m.css +47 -0
- package/src/components/Atoms/PublishDetail/publish-details.test.js +22 -0
- package/src/components/Atoms/PublishDetail/stories.js +21 -0
- package/src/components/Atoms/ReadTime/README.md +13 -0
- package/src/components/Atoms/ReadTime/index.js +44 -0
- package/src/components/Atoms/ReadTime/read-time.m.css +25 -0
- package/src/components/Atoms/ReadTime/read-time.test.js +18 -0
- package/src/components/Atoms/ReadTime/stories.js +19 -0
- package/src/components/Atoms/ScrollSnap/SliderArrow/index.js +57 -0
- package/src/components/Atoms/ScrollSnap/SliderArrow/slider-arrow.m.css +45 -0
- package/src/components/Atoms/ScrollSnap/SliderIndicator/index.js +41 -0
- package/src/components/Atoms/ScrollSnap/SliderIndicator/slider-indicator.m.css +71 -0
- package/src/components/Atoms/ScrollSnap/index.js +136 -0
- package/src/components/Atoms/ScrollSnap/scroll-snap.m.css +27 -0
- package/src/components/Atoms/SectionTag/README.md +11 -0
- package/src/components/Atoms/SectionTag/index.js +61 -0
- package/src/components/Atoms/SectionTag/section.m.css +53 -0
- package/src/components/Atoms/SectionTag/stories.js +26 -0
- package/src/components/Atoms/SocialSharePopup/README.md +25 -0
- package/src/components/Atoms/SocialSharePopup/__snapshots__/social-share-popup.test.js.snap +653 -0
- package/src/components/Atoms/SocialSharePopup/index.js +61 -0
- package/src/components/Atoms/SocialSharePopup/social-share-popup.m.css +109 -0
- package/src/components/Atoms/SocialSharePopup/social-share-popup.test.js +93 -0
- package/src/components/Atoms/SocialSharePopup/stories.js +19 -0
- package/src/components/Atoms/StoryElements/AlsoRead/README.md +49 -0
- package/src/components/Atoms/StoryElements/AlsoRead/also-read.m.css +135 -0
- package/src/components/Atoms/StoryElements/AlsoRead/also-read.test.js +83 -0
- package/src/components/Atoms/StoryElements/AlsoRead/index.js +117 -0
- package/src/components/Atoms/StoryElements/AlsoRead/stories.js +40 -0
- package/src/components/Atoms/StoryElements/Attachment/README.md +21 -0
- package/src/components/Atoms/StoryElements/Attachment/__snapshots__/attachment.test.js.snap +47 -0
- package/src/components/Atoms/StoryElements/Attachment/attachment.m.css +125 -0
- package/src/components/Atoms/StoryElements/Attachment/attachment.test.js +39 -0
- package/src/components/Atoms/StoryElements/Attachment/index.js +62 -0
- package/src/components/Atoms/StoryElements/Attachment/stories.js +48 -0
- package/src/components/Atoms/StoryElements/BigFact/README.md +9 -0
- package/src/components/Atoms/StoryElements/BigFact/big-fact.m.css +41 -0
- package/src/components/Atoms/StoryElements/BigFact/big-fact.test.js +21 -0
- package/src/components/Atoms/StoryElements/BigFact/index.js +33 -0
- package/src/components/Atoms/StoryElements/BigFact/stories.js +9 -0
- package/src/components/Atoms/StoryElements/BlockQuote/README.md +49 -0
- package/src/components/Atoms/StoryElements/BlockQuote/Svg/curve.js +26 -0
- package/src/components/Atoms/StoryElements/BlockQuote/Svg/edge.js +26 -0
- package/src/components/Atoms/StoryElements/BlockQuote/Svg/icon.m.css +4 -0
- package/src/components/Atoms/StoryElements/BlockQuote/block-quote.m.css +161 -0
- package/src/components/Atoms/StoryElements/BlockQuote/block-quote.test.js +48 -0
- package/src/components/Atoms/StoryElements/BlockQuote/index.js +82 -0
- package/src/components/Atoms/StoryElements/BlockQuote/stories.js +35 -0
- package/src/components/Atoms/StoryElements/Blurb/README.md +43 -0
- package/src/components/Atoms/StoryElements/Blurb/blurb.m.css +55 -0
- package/src/components/Atoms/StoryElements/Blurb/blurb.test.js +46 -0
- package/src/components/Atoms/StoryElements/Blurb/index.js +53 -0
- package/src/components/Atoms/StoryElements/Blurb/stories.js +28 -0
- package/src/components/Atoms/StoryElements/Image/README.md +13 -0
- package/src/components/Atoms/StoryElements/Image/image.m.css +17 -0
- package/src/components/Atoms/StoryElements/Image/image.test.js +20 -0
- package/src/components/Atoms/StoryElements/Image/index.js +57 -0
- package/src/components/Atoms/StoryElements/Image/stories.js +25 -0
- package/src/components/Atoms/StoryElements/ImageSlideshow/README.md +13 -0
- package/src/components/Atoms/StoryElements/ImageSlideshow/image-slideshow.m.css +49 -0
- package/src/components/Atoms/StoryElements/ImageSlideshow/index.js +63 -0
- package/src/components/Atoms/StoryElements/ImageSlideshow/stories.js +34 -0
- package/src/components/Atoms/StoryElements/QuestionAnswer/README.md +56 -0
- package/src/components/Atoms/StoryElements/QuestionAnswer/index.js +134 -0
- package/src/components/Atoms/StoryElements/QuestionAnswer/question-answer.m.css +106 -0
- package/src/components/Atoms/StoryElements/QuestionAnswer/question-answer.test.js +74 -0
- package/src/components/Atoms/StoryElements/QuestionAnswer/stories.js +79 -0
- package/src/components/Atoms/StoryElements/Quote/README.md +41 -0
- package/src/components/Atoms/StoryElements/Quote/index.js +44 -0
- package/src/components/Atoms/StoryElements/Quote/quote.m.css +111 -0
- package/src/components/Atoms/StoryElements/Quote/quote.test.js +39 -0
- package/src/components/Atoms/StoryElements/Quote/stories.js +28 -0
- package/src/components/Atoms/StoryElements/Reference/README.md +9 -0
- package/src/components/Atoms/StoryElements/Reference/index.js +52 -0
- package/src/components/Atoms/StoryElements/Reference/reference.m.css +42 -0
- package/src/components/Atoms/StoryElements/Reference/reference.test.js +28 -0
- package/src/components/Atoms/StoryElements/Reference/stories.js +18 -0
- package/src/components/Atoms/StoryElements/StoryElement/README.md +10 -0
- package/src/components/Atoms/StoryElements/StoryElement/index.js +21 -0
- package/src/components/Atoms/StoryElements/StoryElement/stories.js +20 -0
- package/src/components/Atoms/StoryElements/StoryElement/storyelement.test.js +13 -0
- package/src/components/Atoms/StoryElements/Summary/README.md +56 -0
- package/src/components/Atoms/StoryElements/Summary/index.js +68 -0
- package/src/components/Atoms/StoryElements/Summary/stories.js +33 -0
- package/src/components/Atoms/StoryElements/Summary/summary.m.css +121 -0
- package/src/components/Atoms/StoryElements/Summary/summary.test.js +50 -0
- package/src/components/Atoms/StoryElements/Text/README.md +32 -0
- package/src/components/Atoms/StoryElements/Text/index.js +41 -0
- package/src/components/Atoms/StoryElements/Text/stories.js +32 -0
- package/src/components/Atoms/StoryElements/Text/text.m.css +48 -0
- package/src/components/Atoms/StoryElements/Text/text.test.js +42 -0
- package/src/components/Atoms/StoryElements/Video/README.md +9 -0
- package/src/components/Atoms/StoryElements/Video/index.js +23 -0
- package/src/components/Atoms/StoryElements/Video/stories.js +24 -0
- package/src/components/Atoms/StoryElements/Video/video.m.css +3 -0
- package/src/components/Atoms/StoryElements/Video/video.test.js +13 -0
- package/src/components/Atoms/StoryElements/imageGallery/README.md +18 -0
- package/src/components/Atoms/StoryElements/imageGallery/image-gallery.m.css +48 -0
- package/src/components/Atoms/StoryElements/imageGallery/image-gallery.test.js +19 -0
- package/src/components/Atoms/StoryElements/imageGallery/index.js +74 -0
- package/src/components/Atoms/StoryElements/imageGallery/stories.js +23 -0
- package/src/components/Atoms/StoryElements/withElementWrapper.js +13 -0
- package/src/components/Atoms/StoryElements/withElementWrapper.test.js +31 -0
- package/src/components/Atoms/StoryHeadline/index.js +36 -0
- package/src/components/Atoms/StoryHeadline/story-headline.m.css +36 -0
- package/src/components/Atoms/StoryTags/README.md +9 -0
- package/src/components/Atoms/StoryTags/index.js +33 -0
- package/src/components/Atoms/StoryTags/stories.js +25 -0
- package/src/components/Atoms/StoryTags/story-tags.test.js +18 -0
- package/src/components/Atoms/StoryTags/tags.m.css +34 -0
- package/src/components/Atoms/Subheadline/README.md +17 -0
- package/src/components/Atoms/Subheadline/index.js +54 -0
- package/src/components/Atoms/Subheadline/stories.js +12 -0
- package/src/components/Atoms/Subheadline/subheadline.m.css +17 -0
- package/src/components/Atoms/TimeStamp/README.md +9 -0
- package/src/components/Atoms/TimeStamp/index.js +37 -0
- package/src/components/Atoms/TimeStamp/stories.js +9 -0
- package/src/components/Atoms/TimeStamp/timestamp.m.css +22 -0
- package/src/components/Fixture/config.json +2703 -0
- package/src/components/Fixture/dummy-collection.js +2787 -0
- package/src/components/Fixture/dummyStory.js +2148 -0
- package/src/components/Fixture/index.js +424 -0
- package/src/components/Fixture/slot-config.js +29 -0
- package/src/components/Molecules/FullScreenImages/fullscreenimages.scss +48 -0
- package/src/components/Molecules/FullScreenImages/index.js +86 -0
- package/src/components/Molecules/KeyEvents/README.md +21 -0
- package/src/components/Molecules/KeyEvents/index.js +109 -0
- package/src/components/Molecules/KeyEvents/key-events.m.css +89 -0
- package/src/components/Molecules/KeyEvents/stories.js +28 -0
- package/src/components/Molecules/PageIntroductionCard/README.md +25 -0
- package/src/components/Molecules/PageIntroductionCard/index.js +50 -0
- package/src/components/Molecules/PageIntroductionCard/page-intro-card.m.css +61 -0
- package/src/components/Molecules/PageIntroductionCard/stories.js +16 -0
- package/src/components/Molecules/SliderHorizontalCard/README.md +14 -0
- package/src/components/Molecules/SliderHorizontalCard/index.js +45 -0
- package/src/components/Molecules/SliderHorizontalCard/slider-horizontal-card.m.css +42 -0
- package/src/components/Molecules/SliderHorizontalCard/stories.js +30 -0
- package/src/components/Molecules/SocialShareTemplate/README.md +118 -0
- package/src/components/Molecules/SocialShareTemplate/__snapshots__/social-share-template.test.js.snap +738 -0
- package/src/components/Molecules/SocialShareTemplate/index.js +119 -0
- package/src/components/Molecules/SocialShareTemplate/social-share-data.js +66 -0
- package/src/components/Molecules/SocialShareTemplate/social-share-template.m.css +174 -0
- package/src/components/Molecules/SocialShareTemplate/social-share-template.test.js +116 -0
- package/src/components/Molecules/SocialShareTemplate/stories.js +40 -0
- package/src/components/Molecules/StoryCard/README.md +75 -0
- package/src/components/Molecules/StoryCard/READMEBGIMAGE.md +25 -0
- package/src/components/Molecules/StoryCard/READMEBORDER.md +61 -0
- package/src/components/Molecules/StoryCard/index.js +173 -0
- package/src/components/Molecules/StoryCard/stories.js +223 -0
- package/src/components/Molecules/StoryCard/storycard.m.css +158 -0
- package/src/components/Molecules/StoryCardWithBulletPoint/README.md +9 -0
- package/src/components/Molecules/StoryCardWithBulletPoint/index.js +32 -0
- package/src/components/Molecules/StoryCardWithBulletPoint/stories.js +31 -0
- package/src/components/Molecules/StoryCardWithBulletPoint/story-card-with-bullet-point.m.css +7 -0
- package/src/components/Molecules/StoryElementCard/README.md +9 -0
- package/src/components/Molecules/StoryElementCard/index.js +358 -0
- package/src/components/Molecules/StoryElementCard/stories.js +27 -0
- package/src/components/Molecules/StoryElementCard/story-element-card.m.css +78 -0
- package/src/components/Molecules/StorycardContent/README.md +34 -0
- package/src/components/Molecules/StorycardContent/index.js +76 -0
- package/src/components/Molecules/StorycardContent/stories.js +39 -0
- package/src/components/Molecules/StorycardContent/storycardContent.m.css +21 -0
- package/src/components/Rows/AlternateCollectionFilter/README.md +38 -0
- package/src/components/Rows/AlternateCollectionFilter/alternate-collection-filter.m.css +254 -0
- package/src/components/Rows/AlternateCollectionFilter/index.js +179 -0
- package/src/components/Rows/AlternateCollectionFilter/stories.js +74 -0
- package/src/components/Rows/AsideCollection/README.md +27 -0
- package/src/components/Rows/AsideCollection/aside-collection.m.css +103 -0
- package/src/components/Rows/AsideCollection/aside-collection.test.js +34 -0
- package/src/components/Rows/AsideCollection/index.js +175 -0
- package/src/components/Rows/AsideCollection/stories.js +52 -0
- package/src/components/Rows/AuthorIntroductionCard/README.md +43 -0
- package/src/components/Rows/AuthorIntroductionCard/author-intro.m.css +278 -0
- package/src/components/Rows/AuthorIntroductionCard/author-intro.test.js +106 -0
- package/src/components/Rows/AuthorIntroductionCard/index.js +120 -0
- package/src/components/Rows/AuthorIntroductionCard/stories.js +43 -0
- package/src/components/Rows/AuthorsList/README.md +24 -0
- package/src/components/Rows/AuthorsList/author-list.test.js +50 -0
- package/src/components/Rows/AuthorsList/authors-list.m.css +22 -0
- package/src/components/Rows/AuthorsList/index.js +50 -0
- package/src/components/Rows/AuthorsList/stories.js +61 -0
- package/src/components/Rows/CollectionFilter/README.md +39 -0
- package/src/components/Rows/CollectionFilter/collection-filter.m.css +213 -0
- package/src/components/Rows/CollectionFilter/index.js +232 -0
- package/src/components/Rows/CollectionFilter/stories.js +77 -0
- package/src/components/Rows/ElevenStories/11-stories.m.css +85 -0
- package/src/components/Rows/ElevenStories/README.md +39 -0
- package/src/components/Rows/ElevenStories/index.js +332 -0
- package/src/components/Rows/ElevenStories/stories.js +70 -0
- package/src/components/Rows/FourColFiveStories/README.md +37 -0
- package/src/components/Rows/FourColFiveStories/four-col-five-stories.m.css +56 -0
- package/src/components/Rows/FourColFiveStories/index.js +159 -0
- package/src/components/Rows/FourColFiveStories/stories.js +67 -0
- package/src/components/Rows/FourColGrid/README.md +38 -0
- package/src/components/Rows/FourColGrid/four-col.m.css +50 -0
- package/src/components/Rows/FourColGrid/index.js +137 -0
- package/src/components/Rows/FourColGrid/stories.js +65 -0
- package/src/components/Rows/FourColSixteenStories/README.md +35 -0
- package/src/components/Rows/FourColSixteenStories/four-col-sixteen-stories.m.css +104 -0
- package/src/components/Rows/FourColSixteenStories/index.js +103 -0
- package/src/components/Rows/FourColSixteenStories/stories.js +46 -0
- package/src/components/Rows/FourColTwelveStory/README.md +39 -0
- package/src/components/Rows/FourColTwelveStory/four-col-twelve-story.m.css +71 -0
- package/src/components/Rows/FourColTwelveStory/index.js +176 -0
- package/src/components/Rows/FourColTwelveStory/stories.js +117 -0
- package/src/components/Rows/FourStorySlider/README.md +45 -0
- package/src/components/Rows/FourStorySlider/four-story-slider.m.css +45 -0
- package/src/components/Rows/FourStorySlider/index.js +127 -0
- package/src/components/Rows/FourStorySlider/stories.js +117 -0
- package/src/components/Rows/FourTabbedBigStorySlider/README.md +39 -0
- package/src/components/Rows/FourTabbedBigStorySlider/four-tabbed-big-story-slider.m.css +221 -0
- package/src/components/Rows/FourTabbedBigStorySlider/index.js +161 -0
- package/src/components/Rows/FourTabbedBigStorySlider/stories.js +63 -0
- package/src/components/Rows/FullScreenSlider/README.md +46 -0
- package/src/components/Rows/FullScreenSlider/full-screen-slider.m.css +110 -0
- package/src/components/Rows/FullScreenSlider/index.js +114 -0
- package/src/components/Rows/FullScreenSlider/stories.js +115 -0
- package/src/components/Rows/HalfScreenSlider/README.md +43 -0
- package/src/components/Rows/HalfScreenSlider/half-screen-slider.m.css +35 -0
- package/src/components/Rows/HalfScreenSlider/index.js +104 -0
- package/src/components/Rows/HalfScreenSlider/stories.js +115 -0
- package/src/components/Rows/ListComponent/README.md +48 -0
- package/src/components/Rows/ListComponent/index.js +150 -0
- package/src/components/Rows/ListComponent/list-component.m.css +65 -0
- package/src/components/Rows/ListComponent/stories.js +63 -0
- package/src/components/Rows/MagazineEditions/README.md +21 -0
- package/src/components/Rows/MagazineEditions/index.js +91 -0
- package/src/components/Rows/MagazineEditions/magazine-editions.m.css +50 -0
- package/src/components/Rows/MagazineEditions/magazine-editions.test.js +33 -0
- package/src/components/Rows/MagazineEditions/stories.js +45 -0
- package/src/components/Rows/MagazineHeaderCard/README.md +21 -0
- package/src/components/Rows/MagazineHeaderCard/index.js +72 -0
- package/src/components/Rows/MagazineHeaderCard/magazine-cards.m.css +106 -0
- package/src/components/Rows/MagazineHeaderCard/stories.js +36 -0
- package/src/components/Rows/MagazineWidget/README.md +21 -0
- package/src/components/Rows/MagazineWidget/index.js +127 -0
- package/src/components/Rows/MagazineWidget/stories.js +43 -0
- package/src/components/Rows/OneColStoryList/README.md +48 -0
- package/src/components/Rows/OneColStoryList/index.js +196 -0
- package/src/components/Rows/OneColStoryList/one-col-story-list.m.css +81 -0
- package/src/components/Rows/OneColStoryList/stories.js +61 -0
- package/src/components/Rows/OpinionCollection/README.md +34 -0
- package/src/components/Rows/OpinionCollection/index.js +124 -0
- package/src/components/Rows/OpinionCollection/opinion-collection.m.css +118 -0
- package/src/components/Rows/OpinionCollection/stories.js +48 -0
- package/src/components/Rows/SixColSixStories/README.md +37 -0
- package/src/components/Rows/SixColSixStories/index.js +134 -0
- package/src/components/Rows/SixColSixStories/six-col-six-stories.m.css +75 -0
- package/src/components/Rows/SixColSixStories/stories.js +73 -0
- package/src/components/Rows/StoryTemplates/ListicleStoryTemplates/README.md +19 -0
- package/src/components/Rows/StoryTemplates/ListicleStoryTemplates/__snapshots__/listicle-story.test.js.snap +837 -0
- package/src/components/Rows/StoryTemplates/ListicleStoryTemplates/index.js +287 -0
- package/src/components/Rows/StoryTemplates/ListicleStoryTemplates/listicle-story.m.css +229 -0
- package/src/components/Rows/StoryTemplates/ListicleStoryTemplates/listicle-story.test.js +47 -0
- package/src/components/Rows/StoryTemplates/ListicleStoryTemplates/stories.js +117 -0
- package/src/components/Rows/StoryTemplates/LiveBlogStoryTemplates/README.md +25 -0
- package/src/components/Rows/StoryTemplates/LiveBlogStoryTemplates/index.js +51 -0
- package/src/components/Rows/StoryTemplates/LiveBlogStoryTemplates/live-blog.m.css +326 -0
- package/src/components/Rows/StoryTemplates/LiveBlogStoryTemplates/stories.js +120 -0
- package/src/components/Rows/StoryTemplates/LiveBlogStoryTemplates/templates.js +376 -0
- package/src/components/Rows/StoryTemplates/PhotoStoryTemplates/index.js +246 -0
- package/src/components/Rows/StoryTemplates/PhotoStoryTemplates/photo-story.test.js +144 -0
- package/src/components/Rows/StoryTemplates/PhotoStoryTemplates/photo.m.css +175 -0
- package/src/components/Rows/StoryTemplates/PhotoStoryTemplates/stories.js +123 -0
- package/src/components/Rows/StoryTemplates/TextStoryTemplates/README.md +49 -0
- package/src/components/Rows/StoryTemplates/TextStoryTemplates/index.js +69 -0
- package/src/components/Rows/StoryTemplates/TextStoryTemplates/stories.js +125 -0
- package/src/components/Rows/StoryTemplates/TextStoryTemplates/templates.js +272 -0
- package/src/components/Rows/StoryTemplates/TextStoryTemplates/text-story.m.css +449 -0
- package/src/components/Rows/StoryTemplates/TextStoryTemplates/text-story.test.js +222 -0
- package/src/components/Rows/StoryTemplates/VideoStoryTemplates/README.md +31 -0
- package/src/components/Rows/StoryTemplates/VideoStoryTemplates/index.js +234 -0
- package/src/components/Rows/StoryTemplates/VideoStoryTemplates/stories.js +204 -0
- package/src/components/Rows/StoryTemplates/VideoStoryTemplates/video-story.m.css +195 -0
- package/src/components/Rows/TagIntroductionCard/README.md +11 -0
- package/src/components/Rows/TagIntroductionCard/index.js +26 -0
- package/src/components/Rows/TagIntroductionCard/stories.js +21 -0
- package/src/components/Rows/TagIntroductionCard/tag-intro-card.module.css +30 -0
- package/src/components/Rows/ThreeColFlexStories/README.md +38 -0
- package/src/components/Rows/ThreeColFlexStories/index.js +180 -0
- package/src/components/Rows/ThreeColFlexStories/stories.js +73 -0
- package/src/components/Rows/ThreeColFlexStories/three-col-flex-stories.m.css +60 -0
- package/src/components/Rows/ThreeColFourteenStory/README.md +28 -0
- package/src/components/Rows/ThreeColFourteenStory/index.js +135 -0
- package/src/components/Rows/ThreeColFourteenStory/stories.js +60 -0
- package/src/components/Rows/ThreeColFourteenStory/three-col-fourteen-story.m.css +51 -0
- package/src/components/Rows/ThreeColGrid/README.md +36 -0
- package/src/components/Rows/ThreeColGrid/index.js +141 -0
- package/src/components/Rows/ThreeColGrid/stories.js +70 -0
- package/src/components/Rows/ThreeColGrid/three-col.m.css +43 -0
- package/src/components/Rows/ThreeColSevenStory/README.md +36 -0
- package/src/components/Rows/ThreeColSevenStory/index.js +172 -0
- package/src/components/Rows/ThreeColSevenStory/stories.js +71 -0
- package/src/components/Rows/ThreeColSevenStory/three-col-seven-story.m.css +44 -0
- package/src/components/Rows/ThreeColSixStories/README.md +40 -0
- package/src/components/Rows/ThreeColSixStories/index.js +161 -0
- package/src/components/Rows/ThreeColSixStories/stories.js +73 -0
- package/src/components/Rows/ThreeColSixStories/three-col-six-stories.m.css +32 -0
- package/src/components/Rows/ThreeColTwelveStories/README.md +41 -0
- package/src/components/Rows/ThreeColTwelveStories/index.js +123 -0
- package/src/components/Rows/ThreeColTwelveStories/stories.js +51 -0
- package/src/components/Rows/ThreeColTwelveStories/three-col-twelve-stories.m.css +83 -0
- package/src/components/Rows/TwoColFourStory/README.md +33 -0
- package/src/components/Rows/TwoColFourStory/index.js +151 -0
- package/src/components/Rows/TwoColFourStory/stories.js +68 -0
- package/src/components/Rows/TwoColFourStory/two-col-four-story.m.css +56 -0
- package/src/components/Rows/TwoColFourStoryHighlight/README.md +35 -0
- package/src/components/Rows/TwoColFourStoryHighlight/index.js +122 -0
- package/src/components/Rows/TwoColFourStoryHighlight/stories.js +48 -0
- package/src/components/Rows/TwoColFourStoryHighlight/two-col-four-story-highlight.m.css +116 -0
- package/src/components/Rows/TwoColSixStories/README.md +36 -0
- package/src/components/Rows/TwoColSixStories/index.js +117 -0
- package/src/components/Rows/TwoColSixStories/stories.js +67 -0
- package/src/components/Rows/TwoColSixStories/two-col-six-stories.m.css +79 -0
- package/src/components/Rows/TwoColTenStoriesSidebar/README.md +34 -0
- package/src/components/Rows/TwoColTenStoriesSidebar/index.js +168 -0
- package/src/components/Rows/TwoColTenStoriesSidebar/stories.js +45 -0
- package/src/components/Rows/TwoColTenStoriesSidebar/two-col-ten-stories-sidebar.m.css +52 -0
- package/src/components/Rows/TwoColThreeStory/README.md +36 -0
- package/src/components/Rows/TwoColThreeStory/index.js +137 -0
- package/src/components/Rows/TwoColThreeStory/stories.js +68 -0
- package/src/components/Rows/TwoColThreeStory/two-col-three-story.m.css +36 -0
- package/src/components/SharedContext.js +13 -0
- package/src/components/Svgs/Loading/loading.js +133 -0
- package/src/components/Svgs/Loading/loading.m.css +5 -0
- package/src/components/Svgs/SocialIcons/facebook.js +15 -0
- package/src/components/Svgs/SocialIcons/instagram.js +24 -0
- package/src/components/Svgs/SocialIcons/linkedin.js +15 -0
- package/src/components/Svgs/SocialIcons/pinterest.js +12 -0
- package/src/components/Svgs/SocialIcons/twitter.js +15 -0
- package/src/components/Svgs/SocialIcons/whatsapp.js +17 -0
- package/src/components/Svgs/SocialIcons/youtube.js +17 -0
- package/src/components/Svgs/caret-right.svg +3 -0
- package/src/components/Svgs/clock-icon.js +17 -0
- package/src/components/Svgs/close-icon.js +15 -0
- package/src/components/Svgs/crown.js +31 -0
- package/src/components/Svgs/fallbackImage.js +42 -0
- package/src/components/Svgs/key.js +33 -0
- package/src/components/Svgs/left-arrow.js +17 -0
- package/src/components/Svgs/liveicon.js +13 -0
- package/src/components/Svgs/lock.js +31 -0
- package/src/components/Svgs/right-arrow.js +17 -0
- package/src/components/Svgs/share-icon.js +17 -0
- package/src/components/Svgs/star.js +28 -0
- package/src/components/Svgs/user-fallback-icon.js +19 -0
- package/src/components/Typography/README.md +7 -0
- package/src/components/Typography/index.js +47 -0
- package/src/components/Typography/stories.js +10 -0
- package/src/components/Typography/style.m.css +11 -0
- package/src/entry-points.js +337 -0
- package/src/guide/stories.js +18 -0
- package/src/hydration-component/index.js +37 -0
- package/src/hydration-component/useNearScreen.js +56 -0
- package/src/index.js +85 -0
- package/src/utils/testing-utils.js +8 -0
- package/src/utils/utils.js +280 -0
- package/src/utils/utils.test.js +55 -0
- package/storybook/index.js +83 -0
- package/AlsoRead/styles.arrow.css +0 -1
- package/AsideCollection/styles.arrow.css +0 -1
- package/Attachment/styles.arrow.css +0 -1
- package/Author/styles.arrow.css +0 -1
- package/AuthorIntroductionCard/styles.arrow.css +0 -1
- package/AuthorPageIntroductionCard/styles.arrow.css +0 -1
- package/AuthorWithTime/styles.arrow.css +0 -1
- package/AuthorsList/styles.arrow.css +0 -1
- package/BigFact/styles.arrow.css +0 -1
- package/BlockQuote/styles.arrow.css +0 -1
- package/Blurb/styles.arrow.css +0 -1
- package/CollectionFilter/styles.arrow.css +0 -1
- package/CollectionName/styles.arrow.css +0 -1
- package/ElevenStories/styles.arrow.css +0 -1
- package/FourColGrid/styles.arrow.css +0 -1
- package/FourColTwelveStories/styles.arrow.css +0 -1
- package/FourStorySlider/styles.arrow.css +0 -1
- package/FullScreenSlider/styles.arrow.css +0 -1
- package/HalfScreenSlider/styles.arrow.css +0 -1
- package/Headline/styles.arrow.css +0 -1
- package/HeroImage/styles.arrow.css +0 -1
- package/Image/styles.arrow.css +0 -1
- package/ImageGallery/styles.arrow.css +0 -1
- package/ImageSlideshow/styles.arrow.css +0 -1
- package/ListComponent/styles.arrow.css +0 -1
- package/ListicleStoryTemplate/styles.arrow.css +0 -1
- package/LiveBlogStoryTemplate/styles.arrow.css +0 -1
- package/LoadmoreButton/styles.arrow.css +0 -1
- package/MagazineEditions/styles.arrow.css +0 -1
- package/MagazineHeaderCard/styles.arrow.css +0 -1
- package/MagazineWidget/styles.arrow.css +0 -1
- package/OneColStoryList/styles.arrow.css +0 -1
- package/PhotoStoryTemplate/styles.arrow.css +0 -1
- package/QuestionAnswer/styles.arrow.css +0 -1
- package/Quote/styles.arrow.css +0 -1
- package/Reference/styles.arrow.css +0 -1
- package/SectionTag/styles.arrow.css +0 -1
- package/StoryCard/styles.arrow.css +0 -1
- package/StoryElementCard/styles.arrow.css +0 -1
- package/StorycardContent/styles.arrow.css +0 -1
- package/Subheadline/styles.arrow.css +0 -1
- package/Summary/styles.arrow.css +0 -1
- package/TagIntroductionCard/styles.arrow.css +0 -1
- package/Text/styles.arrow.css +0 -1
- package/TextStoryTemplate/styles.arrow.css +0 -1
- package/ThreeColFourteenStories/styles.arrow.css +0 -1
- package/ThreeColGrid/styles.arrow.css +0 -1
- package/ThreeColSevenStory/styles.arrow.css +0 -1
- package/ThreeColSixStories/styles.arrow.css +0 -1
- package/TimeStamp/styles.arrow.css +0 -1
- package/TwoColFourStories/styles.arrow.css +0 -1
- package/TwoColThreeStories/styles.arrow.css +0 -1
- package/Video/styles.arrow.css +0 -1
- package/VideoStoryTemplate/styles.arrow.css +0 -1
- package/cjs/index.js +0 -1
- package/esm/index.js +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { withStore } from "../../../../../storybook";
|
|
3
|
+
import { Image } from "./index";
|
|
4
|
+
import Readme from "./README.md";
|
|
5
|
+
import { generateStoryElementData } from "../../../Fixture";
|
|
6
|
+
|
|
7
|
+
const element = generateStoryElementData("image");
|
|
8
|
+
|
|
9
|
+
withStore(
|
|
10
|
+
"Atoms/Story Elements/Image",
|
|
11
|
+
{
|
|
12
|
+
qt: {
|
|
13
|
+
config: {
|
|
14
|
+
"cdn-image": "gumlet.assettype.com"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
Readme
|
|
19
|
+
)
|
|
20
|
+
.add("Default", () => <Image element={element} />)
|
|
21
|
+
.add("Custom", () => {
|
|
22
|
+
// eslint-disable-next-line react/prop-types
|
|
23
|
+
const customTemplate = ({ element }) => <p>{element.title}</p>;
|
|
24
|
+
return <Image element={element} render={customTemplate} />;
|
|
25
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@import "../../../../../assets/stylesheets/mixins.scss";
|
|
2
|
+
|
|
3
|
+
.slide {
|
|
4
|
+
position: relative;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.slideshow {
|
|
8
|
+
@include mobile {
|
|
9
|
+
width: 90vw;
|
|
10
|
+
margin: 0 auto;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.caption {
|
|
15
|
+
position: absolute;
|
|
16
|
+
bottom: 10px;
|
|
17
|
+
left: 0;
|
|
18
|
+
right: 0;
|
|
19
|
+
text-align: center;
|
|
20
|
+
color: var(--arrow-c-light);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.slideshow figure {
|
|
24
|
+
padding-top: 56.65%;
|
|
25
|
+
position: relative;
|
|
26
|
+
margin: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.image-container::after {
|
|
30
|
+
content: "";
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 0;
|
|
33
|
+
left: 0;
|
|
34
|
+
right: 0;
|
|
35
|
+
bottom: 0;
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 100%;
|
|
38
|
+
background-image: linear-gradient(to top, rgba(var(--arrow-c-dark), 0.5), transparent 70%, transparent);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.image {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
left: 0;
|
|
45
|
+
right: 0;
|
|
46
|
+
bottom: 0;
|
|
47
|
+
height: 100%;
|
|
48
|
+
object-fit: cover;
|
|
49
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { LazyLoadImages, ResponsiveImage } from "@quintype/components";
|
|
2
|
+
import get from "lodash.get";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { shapeStory } from "../../../../utils/utils";
|
|
6
|
+
import { FullScreenImages } from "../../../Molecules/FullScreenImages";
|
|
7
|
+
import { withElementWrapper } from "../withElementWrapper";
|
|
8
|
+
import { ScrollSnap } from "../../ScrollSnap";
|
|
9
|
+
import "./image-slideshow.m.css";
|
|
10
|
+
|
|
11
|
+
const ImageSlideshowBase = (props) => {
|
|
12
|
+
if (!props.element) return null;
|
|
13
|
+
|
|
14
|
+
const Slide = (image, index, onClickHandler) => {
|
|
15
|
+
const { id, "image-s3-key": imageS3Key, metadata, title } = image;
|
|
16
|
+
return (
|
|
17
|
+
<div onClick={() => onClickHandler(index)} styleName="slide" key={id}>
|
|
18
|
+
<figure key={id} styleName="image-container">
|
|
19
|
+
<LazyLoadImages margin={"0px"}>
|
|
20
|
+
<ResponsiveImage
|
|
21
|
+
slug={imageS3Key}
|
|
22
|
+
metadata={metadata}
|
|
23
|
+
aspect-ratio={[16, 9]}
|
|
24
|
+
defaultWidth={480}
|
|
25
|
+
widths={[250, 480, 640]}
|
|
26
|
+
imgParams={{ auto: ["format", "compress"] }}
|
|
27
|
+
styleName="image"
|
|
28
|
+
alt={title}
|
|
29
|
+
/>
|
|
30
|
+
</LazyLoadImages>
|
|
31
|
+
</figure>
|
|
32
|
+
<p styleName="caption">{title}</p>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const ImageSlideshowTemplate = ({ onClickHandler }) => {
|
|
38
|
+
const storyElements = get(props, ["element", "story-elements"], []);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div className="arr--image-slideshow-element" styleName="slideshow" data-test-id="image-slideshow">
|
|
42
|
+
<ScrollSnap slideIndicator={"none"}>
|
|
43
|
+
{storyElements.map((image, index) => Slide(image, index, onClickHandler))}
|
|
44
|
+
</ScrollSnap>
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
ImageSlideshowTemplate.propTypes = {
|
|
50
|
+
onClickHandler: PropTypes.func
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return <FullScreenImages template={ImageSlideshowTemplate} element={props.element} />;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
ImageSlideshowBase.propTypes = {
|
|
57
|
+
element: PropTypes.shape({
|
|
58
|
+
"story-elements": PropTypes.array
|
|
59
|
+
}),
|
|
60
|
+
story: shapeStory
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const ImageSlideshow = withElementWrapper(ImageSlideshowBase);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { withStore } from "../../../../../storybook";
|
|
3
|
+
import { generateStoryElementData } from "../../../Fixture";
|
|
4
|
+
import { ImageSlideshow } from "./index";
|
|
5
|
+
import Readme from "./README.md";
|
|
6
|
+
|
|
7
|
+
const element = generateStoryElementData("image-gallery");
|
|
8
|
+
|
|
9
|
+
withStore(
|
|
10
|
+
"Atoms/Story Elements/Image Slideshow",
|
|
11
|
+
{
|
|
12
|
+
qt: {
|
|
13
|
+
config: {
|
|
14
|
+
"cdn-image": "thumbor-stg.assettype.com"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
Readme
|
|
19
|
+
).add("Default", () => <ImageSlideshow element={element} />);
|
|
20
|
+
|
|
21
|
+
withStore(
|
|
22
|
+
"Atoms/Story Elements/Image Slideshow",
|
|
23
|
+
{
|
|
24
|
+
qt: {
|
|
25
|
+
config: {
|
|
26
|
+
"cdn-image": "thumbor-stg.assettype.com",
|
|
27
|
+
language: {
|
|
28
|
+
direction: "rtl"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
Readme
|
|
34
|
+
).add("Support Rtl", () => <ImageSlideshow element={element} />);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Question & Answer / Question / Answer
|
|
2
|
+
|
|
3
|
+
Displays the question & answer/ question/ answer story element of the story
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
#### Question & Answer/ Question/ Answer story element with default template
|
|
8
|
+
|
|
9
|
+
```jsx
|
|
10
|
+
const opts = { type: "q-and-a / question / answer" };
|
|
11
|
+
|
|
12
|
+
<QuestionAnswer element={element} template="default" opts={opts} />;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
#### Question & Answer/ Question/ Answer story element with author image
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
const opts = { type: "q-and-a / question / answer" };
|
|
19
|
+
|
|
20
|
+
<QuestionAnswer element={element} template="withAuthorImage" opts={opts} />;
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
#### Question & Answer/ Question/ Answer story element with external links opening in new tab
|
|
24
|
+
|
|
25
|
+
```jsx
|
|
26
|
+
const opts = { isExternalLink: true, type: "q-and-a / question / answer" };
|
|
27
|
+
|
|
28
|
+
<QuestionAnswer element={element} template="default" opts={opts} />;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
#### Question & Answer/ Question/ Answer story element with icon type for default template
|
|
32
|
+
|
|
33
|
+
```jsx
|
|
34
|
+
const opts = { defaultIconType: "curve", type: "q-and-a / question / answer" };
|
|
35
|
+
|
|
36
|
+
<QuestionAnswer element={element} template="default" opts={opts} />;
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### Question & Answer/ Question/ Answer story element with icon color
|
|
40
|
+
|
|
41
|
+
```jsx
|
|
42
|
+
const opts = { type: "q-and-a / question / answer" };
|
|
43
|
+
const css = {iconColor: "#ffff"}
|
|
44
|
+
|
|
45
|
+
<QuestionAnswer element={element} template="default" opts={opts} css={css}/>;
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
#### Replace default question & answer/ question/ answer element template with custom template passed using render
|
|
49
|
+
|
|
50
|
+
```jsx
|
|
51
|
+
const customTemplate = ({ element }) => <h3 dangerouslySetInnerHTML={{ __html: element.text }} />;
|
|
52
|
+
|
|
53
|
+
<QuestionAnswer element={element} render={customTemplate} />;
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
<!-- PROPS -->
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import get from "lodash.get";
|
|
4
|
+
import { shapeConfig, shapeStory, updateContentLinks, getTextColor } from "../../../../utils/utils";
|
|
5
|
+
import { withElementWrapper } from "../withElementWrapper";
|
|
6
|
+
import "./question-answer.m.css";
|
|
7
|
+
import { useStateValue } from "../../../SharedContext";
|
|
8
|
+
|
|
9
|
+
const supportedTemplates = (type, element) => {
|
|
10
|
+
switch (type) {
|
|
11
|
+
case "q-and-a":
|
|
12
|
+
const { question: qaQuestion, answer: qaAnswer } = get(element, ["metadata"]);
|
|
13
|
+
const qaQuestionAttribution = get(element, ["metadata", "interviewer", "avatar-url"]);
|
|
14
|
+
const qaAnswerAttribution = get(element, ["metadata", "interviewee", "avatar-url"]);
|
|
15
|
+
return {
|
|
16
|
+
question: qaQuestion,
|
|
17
|
+
answer: qaAnswer,
|
|
18
|
+
questionAttribution: qaQuestionAttribution,
|
|
19
|
+
answerAttribution: qaAnswerAttribution
|
|
20
|
+
};
|
|
21
|
+
case "question":
|
|
22
|
+
const qQuestion = get(element, ["text"]);
|
|
23
|
+
const qAttribution = get(element, ["metadata", "interviewer", "avatar-url"]);
|
|
24
|
+
return {
|
|
25
|
+
question: qQuestion,
|
|
26
|
+
questionAttribution: qAttribution
|
|
27
|
+
};
|
|
28
|
+
case "answer":
|
|
29
|
+
const aAnswer = get(element, ["text"]);
|
|
30
|
+
const aAttribution = get(element, ["metadata", "interviewee", "avatar-url"]);
|
|
31
|
+
return {
|
|
32
|
+
answer: aAnswer,
|
|
33
|
+
answerAttribution: aAttribution
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const QuestionAnswerBase = ({
|
|
39
|
+
element,
|
|
40
|
+
template,
|
|
41
|
+
css = {},
|
|
42
|
+
story = {},
|
|
43
|
+
config = {},
|
|
44
|
+
opts = {},
|
|
45
|
+
render,
|
|
46
|
+
...restProps
|
|
47
|
+
}) => {
|
|
48
|
+
const configData = useStateValue() || {};
|
|
49
|
+
const textInvertColor = getTextColor(configData.theme);
|
|
50
|
+
if (!element) return null;
|
|
51
|
+
const { type, defaultIconType, isExternalLink = true } = opts;
|
|
52
|
+
const { iconColor } = css;
|
|
53
|
+
const { question, answer, questionAttribution, answerAttribution } = supportedTemplates(type, element);
|
|
54
|
+
|
|
55
|
+
const theme = getTextColor(iconColor);
|
|
56
|
+
const questionData = question && ((isExternalLink && updateContentLinks(question)) || question);
|
|
57
|
+
const answerData = answer && ((isExternalLink && updateContentLinks(answer)) || answer);
|
|
58
|
+
const isAuthorImageTemplate = template === "withAuthorImage";
|
|
59
|
+
const templateStyle = isAuthorImageTemplate ? "qa-withAuthorImage" : "qa-default";
|
|
60
|
+
const iconType = defaultIconType === "curve" ? "curveIcon" : "edgeIcon";
|
|
61
|
+
|
|
62
|
+
const supportQuestionElement = isAuthorImageTemplate ? (
|
|
63
|
+
questionAttribution && (
|
|
64
|
+
<>
|
|
65
|
+
<div styleName="labelAttribution">
|
|
66
|
+
<img src={questionAttribution} loading="lazy" />
|
|
67
|
+
</div>
|
|
68
|
+
<span styleName="hidden"></span>
|
|
69
|
+
</>
|
|
70
|
+
)
|
|
71
|
+
) : (
|
|
72
|
+
<div styleName={`${iconType} ${theme}`} data-test-id={iconType} style={{ backgroundColor: iconColor }}>
|
|
73
|
+
Q
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
// EMPTY SPAN FOR EXTRA SPACE
|
|
78
|
+
|
|
79
|
+
const supportAnswerElement = isAuthorImageTemplate ? (
|
|
80
|
+
answerAttribution && (
|
|
81
|
+
<>
|
|
82
|
+
<div styleName="labelAttribution">
|
|
83
|
+
<img src={answerAttribution} loading="lazy" />
|
|
84
|
+
</div>
|
|
85
|
+
<span styleName="hidden"></span>
|
|
86
|
+
</>
|
|
87
|
+
)
|
|
88
|
+
) : (
|
|
89
|
+
<div styleName={`${iconType} ${theme}`} data-test-id={iconType} style={{ backgroundColor: iconColor }}>
|
|
90
|
+
A
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<div
|
|
96
|
+
className="arrow-component arr-custom-style arr--qa-element"
|
|
97
|
+
data-test-id="question-answer"
|
|
98
|
+
styleName={templateStyle}
|
|
99
|
+
{...restProps}>
|
|
100
|
+
{type !== "answer" && (
|
|
101
|
+
<div styleName="q-element" data-test-id="question">
|
|
102
|
+
{supportQuestionElement}
|
|
103
|
+
<div styleName={`content ${textInvertColor}`} dangerouslySetInnerHTML={{ __html: questionData }} />
|
|
104
|
+
</div>
|
|
105
|
+
)}
|
|
106
|
+
{type !== "question" && (
|
|
107
|
+
<div styleName="a-element" data-test-id="answer">
|
|
108
|
+
{supportAnswerElement}
|
|
109
|
+
<div styleName={`content ${textInvertColor}`} dangerouslySetInnerHTML={{ __html: answerData }} />
|
|
110
|
+
</div>
|
|
111
|
+
)}
|
|
112
|
+
</div>
|
|
113
|
+
);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
QuestionAnswerBase.propTypes = {
|
|
117
|
+
element: PropTypes.shape({
|
|
118
|
+
metadata: PropTypes.shape({
|
|
119
|
+
interviewer: PropTypes.shape({ "avatar-url": PropTypes.string }),
|
|
120
|
+
interviewee: PropTypes.shape({ "avatar-url": PropTypes.string }),
|
|
121
|
+
question: PropTypes.string,
|
|
122
|
+
answer: PropTypes.string
|
|
123
|
+
}),
|
|
124
|
+
text: PropTypes.string
|
|
125
|
+
}),
|
|
126
|
+
opts: PropTypes.shape({ type: PropTypes.string, defaultIconType: PropTypes.string, isExternalLink: PropTypes.bool }),
|
|
127
|
+
template: PropTypes.string,
|
|
128
|
+
css: PropTypes.object,
|
|
129
|
+
config: shapeConfig,
|
|
130
|
+
story: shapeStory,
|
|
131
|
+
render: PropTypes.func
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const QuestionAnswer = withElementWrapper(QuestionAnswerBase);
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
@value viewports: "../../../../../assets/stylesheets/viewports.m.css";
|
|
2
|
+
@value mobile from viewports;
|
|
3
|
+
|
|
4
|
+
.qa-withAuthorImage:global(.arrow-component) .a-element p,
|
|
5
|
+
.qa-default:global(.arrow-component) .a-element p,
|
|
6
|
+
.qa-withAuthorImage:global(.arrow-component) .q-element p,
|
|
7
|
+
.qa-default:global(.arrow-component) .q-element p,
|
|
8
|
+
.dark {
|
|
9
|
+
font-size: var(--arrow-fs-s);
|
|
10
|
+
font-weight: var(--arrow-fw-bold);
|
|
11
|
+
line-height: var(--arrow-lh-5);
|
|
12
|
+
display: inline;
|
|
13
|
+
color: var(--arrow-c-mono2);
|
|
14
|
+
@media (min-width: mobile) {
|
|
15
|
+
font-size: var(--arrow-fs-m);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.q-element {
|
|
20
|
+
margin-bottom: var(--arrow-spacing-m);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.qa-withAuthorImage:global(.arrow-component) .a-element p,
|
|
24
|
+
.qa-default:global(.arrow-component) .a-element p {
|
|
25
|
+
font-weight: var(--arrow-fw-normal);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.qa-withAuthorImage .hidden {
|
|
29
|
+
width: 35px;
|
|
30
|
+
display: inline-block;
|
|
31
|
+
@media (min-width: mobile) {
|
|
32
|
+
width: 38px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.qa-default .curveIcon,
|
|
37
|
+
.qa-default .edgeIcon {
|
|
38
|
+
width: 27px;
|
|
39
|
+
height: 27px;
|
|
40
|
+
color: var(--arrow-c-light);
|
|
41
|
+
background-color: var(--arrow-c-brand1);
|
|
42
|
+
font-size: var(--arrow-fs-s);
|
|
43
|
+
font-weight: var(--arrow-fw-bold);
|
|
44
|
+
display: inline-block;
|
|
45
|
+
line-height: var(--arrow-lh-5);
|
|
46
|
+
text-align: center;
|
|
47
|
+
margin-right: var(--arrow-spacing-xs);
|
|
48
|
+
@media (min-width: mobile) {
|
|
49
|
+
width: 30px;
|
|
50
|
+
height: 30px;
|
|
51
|
+
font-size: var(--arrow-fs-m);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.qa-default .edgeIcon {
|
|
56
|
+
border-radius: 2.8px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.qa-default .curveIcon {
|
|
60
|
+
border-radius: 13.5px;
|
|
61
|
+
@media (min-width: mobile) {
|
|
62
|
+
border-radius: 15px;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.qa-withAuthorImage .q-element,
|
|
67
|
+
.qa-withAuthorImage .a-element {
|
|
68
|
+
position: relative;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.qa-withAuthorImage .labelAttribution img {
|
|
72
|
+
width: 27px;
|
|
73
|
+
height: 27px;
|
|
74
|
+
border-radius: 16px;
|
|
75
|
+
position: absolute;
|
|
76
|
+
@media (min-width: mobile) {
|
|
77
|
+
width: 30px;
|
|
78
|
+
height: 30px;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.qa-withAuthorImage:global(.arrow-component) .a-element .light p,
|
|
83
|
+
.qa-default:global(.arrow-component) .a-element .light p,
|
|
84
|
+
.qa-withAuthorImage:global(.arrow-component) .q-element .light p,
|
|
85
|
+
.qa-default:global(.arrow-component) .q-element .light p {
|
|
86
|
+
color: var(--arrow-c-invert-mono1);
|
|
87
|
+
a {
|
|
88
|
+
color: var(--arrow-c-invert-mono2);
|
|
89
|
+
border-bottom: 1px solid var(--arrow-c-invert-mono2);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.content {
|
|
94
|
+
display: inline;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
html[dir="rtl"] {
|
|
98
|
+
.content {
|
|
99
|
+
margin-right: var(--arrow-spacing-s);
|
|
100
|
+
}
|
|
101
|
+
.qa-default .curveIcon,
|
|
102
|
+
.qa-default .edgeIcon {
|
|
103
|
+
margin-right: 0;
|
|
104
|
+
margin-left: var(--arrow-spacing-xs);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { shallow, mount } from "enzyme";
|
|
3
|
+
import { generateStoryElementData } from "../../../Fixture";
|
|
4
|
+
import { QuestionAnswer } from "./index";
|
|
5
|
+
|
|
6
|
+
const qaElement = generateStoryElementData("q-and-a");
|
|
7
|
+
const qElement = generateStoryElementData("question");
|
|
8
|
+
const aElement = generateStoryElementData("answer");
|
|
9
|
+
|
|
10
|
+
describe("Question & Answer Story Element", () => {
|
|
11
|
+
it("Should render default template", () => {
|
|
12
|
+
const wrapper = mount(<QuestionAnswer element={qaElement} template="default" opts={{ type: "q-and-a" }} />);
|
|
13
|
+
expect(wrapper.find({ "data-test-id": "question-answer" }).prop("className")).toMatch(/qa-default/);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("Should render template with author image", () => {
|
|
17
|
+
const wrapper = mount(<QuestionAnswer element={qaElement} template="withAuthorImage" opts={{ type: "q-and-a" }} />);
|
|
18
|
+
expect(wrapper.find({ "data-test-id": "question-answer" }).prop("className")).toMatch(/qa-withAuthorImage/);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("Should render default template with external link", () => {
|
|
22
|
+
const wrapper = shallow(
|
|
23
|
+
<QuestionAnswer template="default" opts={{ isExternalLink: true, type: "q-and-a" }} element={qaElement} />
|
|
24
|
+
);
|
|
25
|
+
expect(wrapper.html()).toBe(
|
|
26
|
+
'<div data-test-id="question-answer" class="arrow-component arr-custom-style arr--qa-element question-answer-m_qa-default__2fGK3 "><div class="question-answer-m_q-element__1ZA5d" data-test-id="question"><div data-test-id="edgeIcon" class="question-answer-m_edgeIcon__3js6c question-answer-m_dark__O4Mnm">Q</div><div class="question-answer-m_content__16Ng7 question-answer-m_dark__O4Mnm"><p>Is Ready Player One book<a aria-label=\'content\' target=\'_blank\' href="https://www.jbsimmons.com/blog/books-better-than-movies-ready-player-one"> better </a>than the movie?</p></div></div><div class="question-answer-m_a-element__BTxfl" data-test-id="answer"><div data-test-id="edgeIcon" class="question-answer-m_edgeIcon__3js6c question-answer-m_dark__O4Mnm">A</div><div class="question-answer-m_content__16Ng7 question-answer-m_dark__O4Mnm"><p><strong>Ready Player One</strong> is the latest example. I read Earnest Cline\'s <strong><a aria-label=\'content\' target=\'_blank\' href="https://www.jbsimmons.com/blog/books-better-than-movies-ready-player-one">book</a></strong> a couple months before watching Steven Spielberg\'s <strong>movie</strong>. ... The <strong>book</strong> generally fares <strong>better</strong> with reviewers, averaging 4.6 out of 5 stars on Amazon, while the <strong>movie</strong> scores 73% on Rotten Tomatoes.</p></div></div></div>'
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("Should render default template without external link", () => {
|
|
31
|
+
const wrapper = shallow(
|
|
32
|
+
<QuestionAnswer template="default" opts={{ isExternalLink: false, type: "q-and-a" }} element={qaElement} />
|
|
33
|
+
);
|
|
34
|
+
expect(wrapper.html()).toBe(
|
|
35
|
+
'<div data-test-id="question-answer" class="arrow-component arr-custom-style arr--qa-element question-answer-m_qa-default__2fGK3 "><div class="question-answer-m_q-element__1ZA5d" data-test-id="question"><div data-test-id="edgeIcon" class="question-answer-m_edgeIcon__3js6c question-answer-m_dark__O4Mnm">Q</div><div class="question-answer-m_content__16Ng7 question-answer-m_dark__O4Mnm"><p>Is Ready Player One book<a href="https://www.jbsimmons.com/blog/books-better-than-movies-ready-player-one"> better </a>than the movie?</p></div></div><div class="question-answer-m_a-element__BTxfl" data-test-id="answer"><div data-test-id="edgeIcon" class="question-answer-m_edgeIcon__3js6c question-answer-m_dark__O4Mnm">A</div><div class="question-answer-m_content__16Ng7 question-answer-m_dark__O4Mnm"><p><strong>Ready Player One</strong> is the latest example. I read Earnest Cline\'s <strong><a href="https://www.jbsimmons.com/blog/books-better-than-movies-ready-player-one">book</a></strong> a couple months before watching Steven Spielberg\'s <strong>movie</strong>. ... The <strong>book</strong> generally fares <strong>better</strong> with reviewers, averaging 4.6 out of 5 stars on Amazon, while the <strong>movie</strong> scores 73% on Rotten Tomatoes.</p></div></div></div>'
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("Should render the default template with icon type", () => {
|
|
40
|
+
const wrapper1 = mount(
|
|
41
|
+
<QuestionAnswer template="default" opts={{ type: "q-and-a", defaultIconType: "curve" }} element={qaElement} />
|
|
42
|
+
);
|
|
43
|
+
expect(wrapper1.find({ "data-test-id": "curveIcon" }).length).toEqual(2);
|
|
44
|
+
const wrapper2 = mount(
|
|
45
|
+
<QuestionAnswer template="default" opts={{ type: "q-and-a", defaultIconType: "edge" }} element={qaElement} />
|
|
46
|
+
);
|
|
47
|
+
expect(wrapper2.find({ "data-test-id": "edgeIcon" }).length).toEqual(2);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("Should render custom template", () => {
|
|
51
|
+
// eslint-disable-next-line react/prop-types
|
|
52
|
+
const customTemplate = ({ element }) => <h3 dangerouslySetInnerHTML={{ __html: element.text }} />;
|
|
53
|
+
const wrapper = shallow(<QuestionAnswer element={qaElement} render={customTemplate} />);
|
|
54
|
+
expect(wrapper.html()).toBe(
|
|
55
|
+
'<h3><div><div class="question"><p>Is Ready Player One book<a href="https://www.jbsimmons.com/blog/books-better-than-movies-ready-player-one"> better </a>than the movie?</p></div><div class="answer"><p><strong>Ready Player One</strong> is the latest example. I read Earnest Cline\'s <strong><a href="https://www.jbsimmons.com/blog/books-better-than-movies-ready-player-one">book</a></strong> a couple months before watching Steven Spielberg\'s <strong>movie</strong>. ... The <strong>book</strong> generally fares <strong>better</strong> with reviewers, averaging 4.6 out of 5 stars on Amazon, while the <strong>movie</strong> scores 73% on Rotten Tomatoes.</p></div></div></h3>'
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
describe("Question Story Element", () => {
|
|
61
|
+
it("Should render question", () => {
|
|
62
|
+
const wrapper = mount(<QuestionAnswer element={qElement} template="default" opts={{ type: "question" }} />);
|
|
63
|
+
expect(wrapper.find({ "data-test-id": "answer" }).length).toEqual(0);
|
|
64
|
+
expect(wrapper.find({ "data-test-id": "question" }).length).toEqual(1);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
describe("Answer Story Element", () => {
|
|
69
|
+
it("Should render answer", () => {
|
|
70
|
+
const wrapper = mount(<QuestionAnswer element={aElement} template="default" opts={{ type: "answer" }} />);
|
|
71
|
+
expect(wrapper.find({ "data-test-id": "question" }).length).toEqual(0);
|
|
72
|
+
expect(wrapper.find({ "data-test-id": "answer" }).length).toEqual(1);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { generateStoryElementData } from "../../../Fixture";
|
|
4
|
+
import { QuestionAnswer } from "./index";
|
|
5
|
+
import { withStore, optionalSelect } from "../../../../../storybook";
|
|
6
|
+
import Readme from "./README.md";
|
|
7
|
+
import { color, boolean } from "@storybook/addon-knobs";
|
|
8
|
+
|
|
9
|
+
const templateStyle = {
|
|
10
|
+
Default: "default",
|
|
11
|
+
"With Author Image": "withAuthorImage"
|
|
12
|
+
};
|
|
13
|
+
const qaElement = generateStoryElementData("q-and-a");
|
|
14
|
+
const qElement = generateStoryElementData("question");
|
|
15
|
+
const aElement = generateStoryElementData("answer");
|
|
16
|
+
const iconType = {
|
|
17
|
+
edge: "edge",
|
|
18
|
+
curve: "curve"
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
withStore("Atoms/Story Elements/Question Answer", {}, Readme)
|
|
22
|
+
.add("Default", () => (
|
|
23
|
+
<QuestionAnswer
|
|
24
|
+
element={qaElement}
|
|
25
|
+
template={optionalSelect("Template Type", templateStyle)}
|
|
26
|
+
opts={{
|
|
27
|
+
type: "q-and-a",
|
|
28
|
+
defaultIconType: optionalSelect("Icon Type", iconType),
|
|
29
|
+
isExternalLink: boolean("External Link", true)
|
|
30
|
+
}}
|
|
31
|
+
css={{
|
|
32
|
+
iconColor: color("Icon Color", "#ff214b")
|
|
33
|
+
}}
|
|
34
|
+
/>
|
|
35
|
+
))
|
|
36
|
+
.add("Custom", () => {
|
|
37
|
+
const customTemplate = ({ element }) => <h3 dangerouslySetInnerHTML={{ __html: element.text }} />;
|
|
38
|
+
return <QuestionAnswer element={qaElement} render={customTemplate} />;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
withStore("Atoms/Story Elements/Question", {}, Readme)
|
|
42
|
+
.add("Default", () => (
|
|
43
|
+
<QuestionAnswer
|
|
44
|
+
element={qElement}
|
|
45
|
+
template={optionalSelect("Template Type", templateStyle)}
|
|
46
|
+
opts={{
|
|
47
|
+
type: "question",
|
|
48
|
+
defaultIconType: optionalSelect("Icon Type", iconType),
|
|
49
|
+
isExternalLink: boolean("External Link", true)
|
|
50
|
+
}}
|
|
51
|
+
css={{
|
|
52
|
+
iconColor: color("Icon Color", "#ff214b")
|
|
53
|
+
}}
|
|
54
|
+
/>
|
|
55
|
+
))
|
|
56
|
+
.add("Custom", () => {
|
|
57
|
+
const customTemplate = ({ element }) => <h3 dangerouslySetInnerHTML={{ __html: element.text }} />;
|
|
58
|
+
return <QuestionAnswer element={qElement} render={customTemplate} />;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
withStore("Atoms/Story Elements/Answer", {}, Readme)
|
|
62
|
+
.add("Default", () => (
|
|
63
|
+
<QuestionAnswer
|
|
64
|
+
element={aElement}
|
|
65
|
+
template={optionalSelect("Template Type", templateStyle)}
|
|
66
|
+
opts={{
|
|
67
|
+
type: "answer",
|
|
68
|
+
defaultIconType: optionalSelect("Icon Type", iconType),
|
|
69
|
+
isExternalLink: boolean("External Link", true)
|
|
70
|
+
}}
|
|
71
|
+
css={{
|
|
72
|
+
iconColor: color("Icon Color", "#ff214b")
|
|
73
|
+
}}
|
|
74
|
+
/>
|
|
75
|
+
))
|
|
76
|
+
.add("Custom", () => {
|
|
77
|
+
const customTemplate = ({ element }) => <h3 dangerouslySetInnerHTML={{ __html: element.text }} />;
|
|
78
|
+
return <QuestionAnswer element={aElement} render={customTemplate} />;
|
|
79
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Quote
|
|
2
|
+
|
|
3
|
+
Displays the Quote story element of the story
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
#### Quote story element with default template
|
|
8
|
+
|
|
9
|
+
```jsx
|
|
10
|
+
<Quote element={element} template="borderNone" />
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
#### Quote story element with border left template
|
|
14
|
+
|
|
15
|
+
```jsx
|
|
16
|
+
<Quote element={element} template="borderLeft" />
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
#### Quote story element with border top template
|
|
20
|
+
|
|
21
|
+
```jsx
|
|
22
|
+
<Quote element={element} template="borderTopSmall" />
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
#### Quote story element with border color
|
|
26
|
+
|
|
27
|
+
```jsx
|
|
28
|
+
const css = { borderColor: "#ff214b" };
|
|
29
|
+
|
|
30
|
+
<Quote element={element} template="borderLeft" css={css} />;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
#### Replace default quote element template with custom template passed using render
|
|
34
|
+
|
|
35
|
+
```jsx
|
|
36
|
+
const customTemplate = ({ element }) => <h3 dangerouslySetInnerHTML={{ __html: element.text }} />;
|
|
37
|
+
|
|
38
|
+
<Quote element={element} render={customTemplate} />;
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
<!-- PROPS -->
|