@explorer-1/vue 0.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/LICENSE +21 -0
- package/README.md +9 -0
- package/components.d.ts +215 -0
- package/index.html +18 -0
- package/lib/main.ts +78 -0
- package/package.json +54 -0
- package/postcss.config.js +7 -0
- package/public/edu/.gitkeep +0 -0
- package/public/edu/explorer-1/bg-stars-edu.png +0 -0
- package/public/edu/explorer-1/bg-stars.jpg +0 -0
- package/public/explorer-1/bg-stars-edu.png +0 -0
- package/public/explorer-1/bg-stars.jpg +0 -0
- package/src/App.vue +30 -0
- package/src/assets/fonts/README.md +12 -0
- package/src/assets/fonts/archivo-narrow/ArchivoNarrow-Bold.woff2 +0 -0
- package/src/assets/fonts/archivo-narrow/ArchivoNarrow-BoldItalic.woff2 +0 -0
- package/src/assets/fonts/archivo-narrow/ArchivoNarrow-SemiBold.woff2 +0 -0
- package/src/assets/fonts/archivo-narrow/ArchivoNarrow-SemiBoldItalic.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-Bold.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-BoldItalic.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-ExtraBold.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-Medium.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-MediumItalic.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-Regular.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-RegularItalic.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-SemiBold.woff2 +0 -0
- package/src/assets/fonts/metropolis/Metropolis-SemiBoldItalic.woff2 +0 -0
- package/src/assets/scss/styles.scss +1 -0
- package/src/components/AsteroidWatchWidget/AsteroidWatchWidget.stories.js +156 -0
- package/src/components/AsteroidWatchWidget/AsteroidWatchWidget.vue +156 -0
- package/src/components/BackToTop/BackToTop.stories.js +24 -0
- package/src/components/BackToTop/BackToTop.vue +76 -0
- package/src/components/BaseAudio/BaseAudio.stories.js +29 -0
- package/src/components/BaseAudio/BaseAudio.vue +359 -0
- package/src/components/BaseButton/BaseButton.stories.ts +65 -0
- package/src/components/BaseButton/BaseButton.vue +114 -0
- package/src/components/BaseCheckboxGroup/BaseCheckboxGroup.stories.mdx +68 -0
- package/src/components/BaseCheckboxGroup/BaseCheckboxGroup.vue +101 -0
- package/src/components/BaseHeading/BaseHeading.stories.js +75 -0
- package/src/components/BaseHeading/BaseHeading.vue +58 -0
- package/src/components/BaseImage/BaseImage.stories.ts +52 -0
- package/src/components/BaseImage/BaseImage.vue +120 -0
- package/src/components/BaseImageCaption/BaseImageCaption.stories.js +27 -0
- package/src/components/BaseImageCaption/BaseImageCaption.vue +51 -0
- package/src/components/BaseImagePlaceholder/BaseImagePlaceholder.stories.js +73 -0
- package/src/components/BaseImagePlaceholder/BaseImagePlaceholder.vue +90 -0
- package/src/components/BaseLightboxCloseButton/BaseLightboxCloseButton.vue +45 -0
- package/src/components/BaseLightboxOpenButton/BaseLightboxOpenButton.vue +46 -0
- package/src/components/BaseLink/BaseLink.stories.js +47 -0
- package/src/components/BaseLink/BaseLink.vue +227 -0
- package/src/components/BaseModal/BaseModal.stories.js +90 -0
- package/src/components/BaseModal/BaseModal.vue +54 -0
- package/src/components/BaseModal/BaseModalDialog.vue +59 -0
- package/src/components/BasePlaceholder/BasePlaceholder.stories.js +29 -0
- package/src/components/BasePlaceholder/BasePlaceholder.vue +30 -0
- package/src/components/BaseRadioGroup/BaseRadioGroup.stories.mdx +68 -0
- package/src/components/BaseRadioGroup/BaseRadioGroup.vue +102 -0
- package/src/components/BaseSwimlane/BaseSwimlane.stories.mdx +64 -0
- package/src/components/BaseSwimlane/BaseSwimlane.vue +204 -0
- package/src/components/BaseTag/BaseTag.stories.js +34 -0
- package/src/components/BaseTag/BaseTag.vue +36 -0
- package/src/components/BaseTimer/BaseTimer.stories.js +78 -0
- package/src/components/BaseTimer/BaseTimer.test.js +15 -0
- package/src/components/BaseTimer/BaseTimer.vue +270 -0
- package/src/components/BaseUnitToggle/BaseUnitToggle.stories.js +86 -0
- package/src/components/BaseUnitToggle/BaseUnitToggle.test.js +26 -0
- package/src/components/BaseUnitToggle/BaseUnitToggle.vue +255 -0
- package/src/components/BaseVideo/BaseVideo.stories.js +31 -0
- package/src/components/BaseVideo/BaseVideo.vue +73 -0
- package/src/components/BlockAnchor/BlockAnchor.vue +38 -0
- package/src/components/BlockAudio/BlockAudio.stories.js +29 -0
- package/src/components/BlockAudio/BlockAudio.vue +78 -0
- package/src/components/BlockCard/BlockCard.stories.js +24 -0
- package/src/components/BlockCard/BlockCard.vue +88 -0
- package/src/components/BlockCardGroup/BlockCardGroup.stories.js +71 -0
- package/src/components/BlockCardGroup/BlockCardGroup.vue +61 -0
- package/src/components/BlockCircleImageCard/BlockCircleImageCard.stories.js +55 -0
- package/src/components/BlockCircleImageCard/BlockCircleImageCard.vue +120 -0
- package/src/components/BlockCta/BlockCta.stories.js +35 -0
- package/src/components/BlockCta/BlockCta.vue +55 -0
- package/src/components/BlockHeading/BlockHeading.stories.js +22 -0
- package/src/components/BlockHeading/BlockHeading.vue +27 -0
- package/src/components/BlockIframeEmbed/BlockIframeEmbed.stories.js +40 -0
- package/src/components/BlockIframeEmbed/BlockIframeEmbed.vue +84 -0
- package/src/components/BlockImage/BlockImage.stories.js +137 -0
- package/src/components/BlockImage/BlockImage.vue +48 -0
- package/src/components/BlockImage/BlockImageFullBleed.vue +119 -0
- package/src/components/BlockImage/BlockImageStandard.vue +106 -0
- package/src/components/BlockImageCarousel/BlockImageCarousel.stories.js +108 -0
- package/src/components/BlockImageCarousel/BlockImageCarousel.vue +201 -0
- package/src/components/BlockImageCarouselItem/BlockImageCarouselItem.stories.js +63 -0
- package/src/components/BlockImageCarouselItem/BlockImageCarouselItem.vue +120 -0
- package/src/components/BlockImageComparison/BlockImageComparison.stories.js +46 -0
- package/src/components/BlockImageComparison/BlockImageComparison.vue +59 -0
- package/src/components/BlockImageGallery/BlockImageGallery.stories.js +55 -0
- package/src/components/BlockImageGallery/BlockImageGallery.vue +128 -0
- package/src/components/BlockInlineImage/BlockInlineImage.stories.js +68 -0
- package/src/components/BlockInlineImage/BlockInlineImage.vue +124 -0
- package/src/components/BlockKeyPoints/BlockKeyPoints.stories.js +28 -0
- package/src/components/BlockKeyPoints/BlockKeyPoints.vue +48 -0
- package/src/components/BlockLinkCard/BlockLinkCard.stories.js +102 -0
- package/src/components/BlockLinkCard/BlockLinkCard.vue +197 -0
- package/src/components/BlockLinkCarousel/BlockLinkCarousel.stories.js +217 -0
- package/src/components/BlockLinkCarousel/BlockLinkCarousel.vue +68 -0
- package/src/components/BlockLinkTile/BlockLinkTile.stories.js +72 -0
- package/src/components/BlockLinkTile/BlockLinkTile.vue +193 -0
- package/src/components/BlockListCards/BlockListCards.stories.js +69 -0
- package/src/components/BlockListCards/BlockListCards.vue +129 -0
- package/src/components/BlockQuote/BlockQuote.stories.js +84 -0
- package/src/components/BlockQuote/BlockQuote.vue +87 -0
- package/src/components/BlockRelatedLinks/BlockRelatedLinks.stories.js +60 -0
- package/src/components/BlockRelatedLinks/BlockRelatedLinks.vue +77 -0
- package/src/components/BlockRelatedLinks/RelatedLink.vue +85 -0
- package/src/components/BlockStreamfield/BlockStreamfield.stories.js +88 -0
- package/src/components/BlockStreamfield/BlockStreamfield.vue +333 -0
- package/src/components/BlockTable/BlockTable.stories.js +20 -0
- package/src/components/BlockTable/BlockTable.vue +73 -0
- package/src/components/BlockTeaser/BlockTeaser.stories.js +74 -0
- package/src/components/BlockTeaser/BlockTeaser.test.js +12 -0
- package/src/components/BlockTeaser/BlockTeaser.vue +174 -0
- package/src/components/BlockText/BlockText.stories.js +21 -0
- package/src/components/BlockText/BlockText.vue +44 -0
- package/src/components/BlockTwitterEmbed/BlockTwitterEmbed.stories.js +19 -0
- package/src/components/BlockTwitterEmbed/BlockTwitterEmbed.vue +61 -0
- package/src/components/BlockVideo/BlockVideo.stories.js +23 -0
- package/src/components/BlockVideo/BlockVideo.vue +41 -0
- package/src/components/BlockVideoEmbed/BlockVideoEmbed.stories.js +20 -0
- package/src/components/BlockVideoEmbed/BlockVideoEmbed.vue +71 -0
- package/src/components/CalendarButton/CalendarButton.stories.js +36 -0
- package/src/components/CalendarButton/CalendarButton.vue +86 -0
- package/src/components/DetailHeadline/DetailHeadline.stories.js +48 -0
- package/src/components/DetailHeadline/DetailHeadline.vue +143 -0
- package/src/components/DsnWidget/DsnWidget.stories.js +29 -0
- package/src/components/DsnWidget/DsnWidget.vue +96 -0
- package/src/components/EventCard/EventCard.vue +188 -0
- package/src/components/EventDetailHero/EventDetailHero.stories.js +53 -0
- package/src/components/EventDetailHero/EventDetailHero.vue +64 -0
- package/src/components/FormContact/FormContact.stories.js +16 -0
- package/src/components/FormContact/FormContact.vue +202 -0
- package/src/components/FormNewsletterSignup/FormNewsletterSignup.stories.js +16 -0
- package/src/components/FormNewsletterSignup/FormNewsletterSignup.vue +355 -0
- package/src/components/HeroLarge/HeroLarge.stories.js +46 -0
- package/src/components/HeroLarge/HeroLarge.vue +93 -0
- package/src/components/HeroListingIndex/HeroListingIndex.stories.js +156 -0
- package/src/components/HeroListingIndex/HeroListingIndex.vue +80 -0
- package/src/components/HeroMedia/HeroMedia.stories.js +135 -0
- package/src/components/HeroMedia/HeroMedia.vue +174 -0
- package/src/components/HeroMedium/HeroMedium.stories.js +73 -0
- package/src/components/HeroMedium/HeroMedium.vue +166 -0
- package/src/components/HomepageCarousel/HomepageCarousel.stories.js +112 -0
- package/src/components/HomepageCarousel/HomepageCarousel.vue +382 -0
- package/src/components/HomepageCarouselItem/HomepageCarouselItem.stories.js +60 -0
- package/src/components/HomepageCarouselItem/HomepageCarouselItem.vue +168 -0
- package/src/components/HomepageEmbedBlock/HomepageEmbedBlock.stories.js +35 -0
- package/src/components/HomepageEmbedBlock/HomepageEmbedBlock.vue +39 -0
- package/src/components/HomepageFeaturedRobot/HomepageFeaturedRobot.stories.js +93 -0
- package/src/components/HomepageFeaturedRobot/HomepageFeaturedRobot.vue +129 -0
- package/src/components/HomepageMissionsCarousel/HomepageMissionsCarousel.stories.js +153 -0
- package/src/components/HomepageMissionsCarousel/HomepageMissionsCarousel.vue +282 -0
- package/src/components/HomepageMissionsCarousel/HomepageMissionsCarouselItem.vue +143 -0
- package/src/components/HomepageStats/HomepageStats.stories.js +155 -0
- package/src/components/HomepageStats/HomepageStats.vue +362 -0
- package/src/components/HomepageTeaserBlock/HomepageTeaserBlock.stories.js +90 -0
- package/src/components/HomepageTeaserBlock/HomepageTeaserBlock.vue +156 -0
- package/src/components/HomepageTeaserBlock/HomepageTeaserBlockCardImage.vue +58 -0
- package/src/components/Icons/Icon360.vue +29 -0
- package/src/components/Icons/IconArrow.vue +26 -0
- package/src/components/Icons/IconArrows.vue +43 -0
- package/src/components/Icons/IconAudio.vue +27 -0
- package/src/components/Icons/IconBook.vue +21 -0
- package/src/components/Icons/IconBookUser.vue +21 -0
- package/src/components/Icons/IconBriefcase.vue +21 -0
- package/src/components/Icons/IconCalendar.vue +25 -0
- package/src/components/Icons/IconCaret.vue +26 -0
- package/src/components/Icons/IconCheckbox.vue +26 -0
- package/src/components/Icons/IconCheckboxSelected.vue +35 -0
- package/src/components/Icons/IconClose.vue +27 -0
- package/src/components/Icons/IconCloseLightbox.vue +25 -0
- package/src/components/Icons/IconDownload.vue +31 -0
- package/src/components/Icons/IconDropdown.vue +25 -0
- package/src/components/Icons/IconEnvelope.vue +21 -0
- package/src/components/Icons/IconExpand.vue +28 -0
- package/src/components/Icons/IconExternal.vue +25 -0
- package/src/components/Icons/IconFilter.vue +25 -0
- package/src/components/Icons/IconForwardTen.vue +38 -0
- package/src/components/Icons/IconGrid.vue +25 -0
- package/src/components/Icons/IconHand.vue +21 -0
- package/src/components/Icons/IconInfo.vue +26 -0
- package/src/components/Icons/IconLink.vue +27 -0
- package/src/components/Icons/IconList.vue +25 -0
- package/src/components/Icons/IconLocation.vue +37 -0
- package/src/components/Icons/IconMagnifyingGlass.vue +21 -0
- package/src/components/Icons/IconMedal.vue +21 -0
- package/src/components/Icons/IconMenu.vue +27 -0
- package/src/components/Icons/IconMinus.vue +26 -0
- package/src/components/Icons/IconMute.vue +27 -0
- package/src/components/Icons/IconNext.vue +25 -0
- package/src/components/Icons/IconPause.vue +28 -0
- package/src/components/Icons/IconPlay.vue +28 -0
- package/src/components/Icons/IconPlus.vue +25 -0
- package/src/components/Icons/IconPrev.vue +25 -0
- package/src/components/Icons/IconRewindTen.vue +42 -0
- package/src/components/Icons/IconSearch.vue +25 -0
- package/src/components/Icons/IconShare.vue +30 -0
- package/src/components/Icons/IconSlideshow.vue +30 -0
- package/src/components/Icons/IconSocialEmail.vue +26 -0
- package/src/components/Icons/IconSocialFacebook.vue +26 -0
- package/src/components/Icons/IconSocialGoogleClassroom.vue +26 -0
- package/src/components/Icons/IconSocialInstagram.vue +35 -0
- package/src/components/Icons/IconSocialPinterest.vue +26 -0
- package/src/components/Icons/IconSocialReddit.vue +25 -0
- package/src/components/Icons/IconSocialTwitter.vue +25 -0
- package/src/components/Icons/IconSocialYoutube.vue +35 -0
- package/src/components/Icons/IconStop.vue +27 -0
- package/src/components/Icons/IconTime.vue +25 -0
- package/src/components/Icons/IconUniversity.vue +21 -0
- package/src/components/Icons/IconUser.vue +26 -0
- package/src/components/Icons/IconVolume.vue +27 -0
- package/src/components/Icons/Icons.stories.ts +440 -0
- package/src/components/ImageDetailContextImage/ImageDetailContextImage.vue +125 -0
- package/src/components/LayoutHelper/LayoutHelper.vue +38 -0
- package/src/components/LoadingTransition/LoadingTransition.vue +48 -0
- package/src/components/LogoCaltech/LogoCaltech.stories.js +39 -0
- package/src/components/LogoCaltech/LogoCaltech.vue +29 -0
- package/src/components/LogoTribrand/LogoTribrand.stories.js +76 -0
- package/src/components/LogoTribrand/LogoTribrand.vue +93 -0
- package/src/components/MissionDetailAbout/MissionDetailAbout.stories.js +70 -0
- package/src/components/MissionDetailAbout/MissionDetailAbout.vue +204 -0
- package/src/components/MissionDetailHero/MissionDetailHero.stories.js +303 -0
- package/src/components/MissionDetailHero/MissionDetailHero.vue +292 -0
- package/src/components/MissionDetailHighlights/MissionDetailHighlights.stories.js +278 -0
- package/src/components/MissionDetailHighlights/MissionDetailHighlights.vue +332 -0
- package/src/components/MissionDetailHighlights/MissionDetailHighlightsCarousel.vue +160 -0
- package/src/components/MissionDetailHighlights/MissionDetailHighlightsCarouselItem.vue +123 -0
- package/src/components/MissionDetailInlineImage/MissionDetailInlineImage.stories.js +43 -0
- package/src/components/MissionDetailInlineImage/MissionDetailInlineImage.vue +97 -0
- package/src/components/MissionDetailStats/DistanceStats.test.js +133 -0
- package/src/components/MissionDetailStats/DistanceStats.vue +250 -0
- package/src/components/MissionDetailStats/MissionDetailStats.stories.js +95 -0
- package/src/components/MissionDetailStats/MissionDetailStats.test.js +23 -0
- package/src/components/MissionDetailStats/MissionDetailStats.vue +187 -0
- package/src/components/MissionDetailStats/MissionDetailStatsMicro.vue +52 -0
- package/src/components/MissionDetailStats/MissionDetailStatsMini.vue +109 -0
- package/src/components/MissionDetailStreamfield/MissionDetailStreamfield.stories.js +55 -0
- package/src/components/MissionDetailStreamfield/MissionDetailStreamfield.vue +95 -0
- package/src/components/MixinAnimationCaret/MixinAnimationCaret.stories.ts +24 -0
- package/src/components/MixinAnimationCaret/MixinAnimationCaret.vue +81 -0
- package/src/components/MixinCarousel/MixinCarousel.docs.mdx +33 -0
- package/src/components/MixinCarousel/MixinCarousel.stories.js +53 -0
- package/src/components/MixinCarousel/MixinCarousel.vue +236 -0
- package/src/components/MixinDropdownToggle/MixinDropdownToggle.vue +53 -0
- package/src/components/MixinFancybox/MixinFancybox.vue +405 -0
- package/src/components/MixinFancybox/MixinFancyboxOpenButton.vue +35 -0
- package/src/components/MixinVideoBg/MixinVideoBg.stories.js +23 -0
- package/src/components/MixinVideoBg/MixinVideoBg.vue +39 -0
- package/src/components/NavDesktop/NavDesktop.stories.js +254 -0
- package/src/components/NavDesktop/NavDesktop.vue +355 -0
- package/src/components/NavDesktop/NavDesktopDropdown.vue +201 -0
- package/src/components/NavDesktop/NavDesktopDropdownContent.vue +87 -0
- package/src/components/NavDesktop/NavDesktopDropdownMore.vue +112 -0
- package/src/components/NavDesktop/NavDesktopTopHat.vue +56 -0
- package/src/components/NavHeading/NavHeading.stories.js +23 -0
- package/src/components/NavHeading/NavHeading.vue +40 -0
- package/src/components/NavHighlight/NavHighlight.stories.js +42 -0
- package/src/components/NavHighlight/NavHighlight.vue +67 -0
- package/src/components/NavLinkList/NavLinkList.stories.js +46 -0
- package/src/components/NavLinkList/NavLinkList.vue +66 -0
- package/src/components/NavLogoLinks/NavLogoLinks.stories.js +22 -0
- package/src/components/NavLogoLinks/NavLogoLinks.vue +57 -0
- package/src/components/NavMobile/NavMobile.stories.js +231 -0
- package/src/components/NavMobile/NavMobile.vue +280 -0
- package/src/components/NavMobile/NavMobileDropdown.vue +175 -0
- package/src/components/NavMobile/NavMobileLink.vue +69 -0
- package/src/components/NavMobile/NavMobileSecondaryDropdown.vue +124 -0
- package/src/components/NavSearchForm/NavSearchForm.stories.js +13 -0
- package/src/components/NavSearchForm/NavSearchForm.vue +102 -0
- package/src/components/NavSecondary/NavSecondary.stories.js +24 -0
- package/src/components/NavSecondary/NavSecondary.vue +191 -0
- package/src/components/NavSecondary/NavSecondaryDropdown.vue +181 -0
- package/src/components/NavSecondary/NavSecondaryDropdownContent.vue +140 -0
- package/src/components/NavSecondary/NavSecondaryLink.vue +62 -0
- package/src/components/NavSocial/NavSocial.stories.js +20 -0
- package/src/components/NavSocial/NavSocial.vue +97 -0
- package/src/components/NewsDetailMediaContact/NewsDetailMediaContact.stories.js +60 -0
- package/src/components/NewsDetailMediaContact/NewsDetailMediaContact.test.js +30 -0
- package/src/components/NewsDetailMediaContact/NewsDetailMediaContact.vue +73 -0
- package/src/components/ParallaxContainer/ParallaxContainer.stories.js +47 -0
- package/src/components/ParallaxContainer/ParallaxContainer.vue +76 -0
- package/src/components/ParallaxElement/ParallaxElement.vue +25 -0
- package/src/components/PastEventsCarousel/PastEventsCarousel.vue +86 -0
- package/src/components/PodcastEpisodeCard/PodcastEpisodeCard.vue +251 -0
- package/src/components/PodcastSeriesCarousel/PodcastSeriesCarousel.stories.js +235 -0
- package/src/components/PodcastSeriesCarousel/PodcastSeriesCarousel.vue +171 -0
- package/src/components/ProfileDetailSectionGroup/ProfileDetailSectionGroup.vue +84 -0
- package/src/components/RoboticsDetailStats/RoboticsDetailStats.stories.js +97 -0
- package/src/components/RoboticsDetailStats/RoboticsDetailStats.test.js +21 -0
- package/src/components/RoboticsDetailStats/RoboticsDetailStats.vue +217 -0
- package/src/components/RoboticsDetailStats/RoboticsDetailStatsMini.vue +182 -0
- package/src/components/SearchFilterGroup/SearchFilterGroup.stories.js +59 -0
- package/src/components/SearchFilterGroup/SearchFilterGroup.vue +221 -0
- package/src/components/SearchInput/SearchInput.stories.js +35 -0
- package/src/components/SearchInput/SearchInput.vue +93 -0
- package/src/components/SearchPagination/SearchPagination.stories.js +55 -0
- package/src/components/SearchPagination/SearchPagination.vue +173 -0
- package/src/components/SearchResultCard/SearchResultCard.stories.js +57 -0
- package/src/components/SearchResultCard/SearchResultCard.vue +282 -0
- package/src/components/SearchResultGridItem/SearchResultGridItem.stories.js +70 -0
- package/src/components/SearchResultGridItem/SearchResultGridItem.vue +140 -0
- package/src/components/SearchResultsList/SearchResultsList.vue +183 -0
- package/src/components/SearchSelectMenu/SearchSelectMenu.stories.js +25 -0
- package/src/components/SearchSelectMenu/SearchSelectMenu.vue +86 -0
- package/src/components/ShareButtons/ShareButtons.stories.js +16 -0
- package/src/components/ShareButtons/ShareButtons.vue +132 -0
- package/src/components/ShareButtonsEdu/ShareButtonsEdu.stories.js +14 -0
- package/src/components/ShareButtonsEdu/ShareButtonsEdu.vue +215 -0
- package/src/components/SkipLink/SkipLink.stories.js +9 -0
- package/src/components/SkipLink/SkipLink.vue +53 -0
- package/src/components/SwimlaneCTA/SwimlaneCTA.stories.mdx +77 -0
- package/src/components/SwimlaneCTA/SwimlaneCTA.vue +281 -0
- package/src/components/TheFooter/TheFooter.stories.js +602 -0
- package/src/components/TheFooter/TheFooter.vue +228 -0
- package/src/components/TheFooter/TheFooterSignUp.vue +61 -0
- package/src/components/ThumbnailCarousel/ThumbnailCarousel.stories.js +106 -0
- package/src/components/ThumbnailCarousel/ThumbnailCarousel.vue +76 -0
- package/src/components/TopicDetailMissionCarousel/TopicDetailMissionCarousel.stories.js +93 -0
- package/src/components/TopicDetailMissionCarousel/TopicDetailMissionCarousel.vue +68 -0
- package/src/components/TopicDetailMissionCarouselItem/TopicDetailMissionCarouselItem.stories.js +38 -0
- package/src/components/TopicDetailMissionCarouselItem/TopicDetailMissionCarouselItem.vue +104 -0
- package/src/components/TopicDetailMissionSpotlight/TopicDetailMissionSpotlight.stories.js +84 -0
- package/src/components/TopicDetailMissionSpotlight/TopicDetailMissionSpotlight.vue +112 -0
- package/src/components/TopicDetailMore/TopicDetailMore.stories.js +221 -0
- package/src/components/TopicDetailMore/TopicDetailMore.vue +124 -0
- package/src/components/TopicDetailMore/TopicDetailMoreVisibility.vue +51 -0
- package/src/components/TopicDetailMoreItem/TopicDetailMoreItem.stories.js +116 -0
- package/src/components/TopicDetailMoreItem/TopicDetailMoreItem.vue +130 -0
- package/src/components/TopicDetailStreamfield/TopicDetailStreamfield.stories.js +34 -0
- package/src/components/TopicDetailStreamfield/TopicDetailStreamfield.vue +98 -0
- package/src/components/YearTicker/YearTicker.stories.js +37 -0
- package/src/components/YearTicker/YearTicker.vue +132 -0
- package/src/docs/foundation/DynamicTokens.vue +106 -0
- package/src/docs/foundation/FontVariants.vue +80 -0
- package/src/docs/foundation/color.docs.mdx +112 -0
- package/src/docs/foundation/grid.docs.mdx +189 -0
- package/src/docs/foundation/grid.stories.js +263 -0
- package/src/docs/foundation/grid_layouthelpers.docs.mdx +78 -0
- package/src/docs/foundation/grid_layouthelpers.stories.js +53 -0
- package/src/docs/foundation/themes.docs.mdx +71 -0
- package/src/docs/foundation/themes.stories.js +63 -0
- package/src/docs/foundation/typography.docs.mdx +50 -0
- package/src/docs/foundation/typography.stories.js +119 -0
- package/src/interfaces.ts +129 -0
- package/src/main.ts +34 -0
- package/src/store/header.ts +40 -0
- package/src/store/theme.ts +27 -0
- package/src/templates/PageContent/PageContent.stories.js +92 -0
- package/src/templates/PageContent/PageContent.vue +140 -0
- package/src/templates/PageEventDetail/PageEventDetail.stories.js +104 -0
- package/src/templates/PageEventDetail/PageEventDetail.vue +358 -0
- package/src/templates/PageNewsDetail/PageNewsDetail.stories.js +158 -0
- package/src/templates/PageNewsDetail/PageNewsDetail.vue +242 -0
- package/src/templates/edu/PageEduNewsDetail.stories.js +64 -0
- package/src/templates/edu/PageEduNewsDetail.vue +155 -0
- package/src/templates/www/HomePage/HomePage.vue +30 -0
- package/src/utils/dayjs.js +32 -0
- package/src/utils/filters.js +33 -0
- package/src/utils/mixins.ts +353 -0
- package/src/vite-env.d.ts +1 -0
- package/tailwind.config.js +24 -0
- package/tsconfig.json +29 -0
- package/tsconfig.node.json +11 -0
- package/vite.config.ts +55 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="hasContent"
|
|
4
|
+
class="RoboticsDetailStats MixedBleedGrid lg:pl-0 relative z-20 pl-4 -mt-12 overflow-hidden"
|
|
5
|
+
>
|
|
6
|
+
<h2 class="sr-only">Robot Statistics</h2>
|
|
7
|
+
<div class="lg:block bg-gray-light col-start-indent-col-2 col-end-indent-col-3 hidden"></div>
|
|
8
|
+
<div
|
|
9
|
+
class="bg-gray-light text-gray-dark col-start-indent-col-3 col-end-container lg:py-12 lg:px-0 text-body-lg lg:gap-x-6 gap-y-8 lg:gap-y-0 grid grid-cols-10 px-8 py-10 pr-0"
|
|
10
|
+
>
|
|
11
|
+
<div class="gap-y-10 lg:col-end-9 grid grid-cols-8 col-start-1 col-end-11 gap-6">
|
|
12
|
+
<!-- We want to fit 3 items per row if possible, so third items only span two columns. -->
|
|
13
|
+
<div
|
|
14
|
+
v-for="(stat, i) in allStats"
|
|
15
|
+
:key="i"
|
|
16
|
+
class="col-span-4"
|
|
17
|
+
:class="(i + 1) % 3 === 0 ? 'lg:col-span-2' : 'lg:col-span-3'"
|
|
18
|
+
>
|
|
19
|
+
<p class="label text-subtitle">{{ stat.metricLabel }}</p>
|
|
20
|
+
<p>
|
|
21
|
+
<span :class="{ 'text-stats-xl': !isNaN(stat.metricValue) }">
|
|
22
|
+
{{ stat.metricValue }}
|
|
23
|
+
</span>
|
|
24
|
+
<span class="text-body-xs text-gray-mid-dark uppercase">{{
|
|
25
|
+
unitLabel(stat.metricUnit)
|
|
26
|
+
}}</span>
|
|
27
|
+
</p>
|
|
28
|
+
</div>
|
|
29
|
+
<div
|
|
30
|
+
v-if="status !== ''"
|
|
31
|
+
class="lg:col-span-3 col-span-4"
|
|
32
|
+
>
|
|
33
|
+
<p class="label text-subtitle">Status</p>
|
|
34
|
+
{{ status }}
|
|
35
|
+
</div>
|
|
36
|
+
<div
|
|
37
|
+
v-if="robotDestinations.length > 0"
|
|
38
|
+
class="lg:col-span-4 col-span-8"
|
|
39
|
+
>
|
|
40
|
+
<p class="label text-subtitle">Potential Destinations</p>
|
|
41
|
+
{{ robotDestinations.map((d) => d.destination).join(', ') }}
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<div
|
|
45
|
+
v-if="animalAnalogIcon && animalAnalogIcon.src"
|
|
46
|
+
class="lg:col-span-2 lg:row-span-2 lg:text-left gap-y-8 col-span-10 -ml-8 text-center"
|
|
47
|
+
>
|
|
48
|
+
<picture class="block">
|
|
49
|
+
<source
|
|
50
|
+
:srcset="animalAnalogIcon.webp.url"
|
|
51
|
+
type="image/webp"
|
|
52
|
+
/>
|
|
53
|
+
<img
|
|
54
|
+
class="lg:mx-0 mx-auto bg-white rounded-full"
|
|
55
|
+
:src="animalAnalogIcon.src.url"
|
|
56
|
+
width="160"
|
|
57
|
+
height="160"
|
|
58
|
+
alt=""
|
|
59
|
+
/>
|
|
60
|
+
</picture>
|
|
61
|
+
<p
|
|
62
|
+
v-if="animalAnalogName"
|
|
63
|
+
class="text-subtitle mt-4"
|
|
64
|
+
>
|
|
65
|
+
{{ `Animal Analog: ${animalAnalogName}` }}
|
|
66
|
+
</p>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<div class="bg-gray-light col-start-container-end col-end-bleed sm:block hidden"></div>
|
|
70
|
+
</div>
|
|
71
|
+
</template>
|
|
72
|
+
<script lang="ts">
|
|
73
|
+
// @ts-nocheck
|
|
74
|
+
import type { PropType } from 'vue'
|
|
75
|
+
import { defineComponent } from 'vue'
|
|
76
|
+
|
|
77
|
+
export const metricUnits = {
|
|
78
|
+
unitless: '',
|
|
79
|
+
gram: 'Gram',
|
|
80
|
+
grams: 'Grams',
|
|
81
|
+
kilogram: 'Kilogram',
|
|
82
|
+
kilograms: 'Kilograms',
|
|
83
|
+
meter: 'Meter',
|
|
84
|
+
meters: 'Meters',
|
|
85
|
+
kilometer: 'Kilometer',
|
|
86
|
+
kilometers: 'Kilometers',
|
|
87
|
+
'm/s': 'm/s'
|
|
88
|
+
} as const
|
|
89
|
+
export type MetricUnit = keyof typeof metricUnits
|
|
90
|
+
export type MetricUnitLabel = (typeof metricUnits)[MetricUnit]
|
|
91
|
+
|
|
92
|
+
export type AlternativeStat = {
|
|
93
|
+
metricLabel: string
|
|
94
|
+
metricValue: number
|
|
95
|
+
metricUnit: MetricUnit
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Displays robot-related metrics or metadata. All fields optional.
|
|
100
|
+
*/
|
|
101
|
+
export default defineComponent({
|
|
102
|
+
name: 'RoboticsDetailStats',
|
|
103
|
+
components: {},
|
|
104
|
+
props: {
|
|
105
|
+
mass: Number,
|
|
106
|
+
height: Number,
|
|
107
|
+
speed: Number,
|
|
108
|
+
// status strings provided by https://github.com/nasa-jpl/www-backend/blob/0b2f934d0c1e3c09a52dbe42fe462f162c9f929b/cms/robotics/models.py#L262
|
|
109
|
+
status: {
|
|
110
|
+
type: String
|
|
111
|
+
},
|
|
112
|
+
animalAnalogIcon: {
|
|
113
|
+
type: Object as PropType<{ src: { url: string }; webp: { url: string } } | null>
|
|
114
|
+
},
|
|
115
|
+
animalAnalogName: String,
|
|
116
|
+
robotDestinations: {
|
|
117
|
+
type: Array as PropType<{ destination: string }[]>,
|
|
118
|
+
required: true
|
|
119
|
+
},
|
|
120
|
+
alternativeStats: {
|
|
121
|
+
type: Array as PropType<AlternativeStat[]>,
|
|
122
|
+
required: true
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
computed: {
|
|
126
|
+
hasContent(): boolean {
|
|
127
|
+
return Boolean(
|
|
128
|
+
this.allStats.length > 0 ||
|
|
129
|
+
this.status !== '' ||
|
|
130
|
+
this.robotDestinations.length > 0 ||
|
|
131
|
+
this.animalAnalogIcon
|
|
132
|
+
)
|
|
133
|
+
},
|
|
134
|
+
allStats(): AlternativeStat[] {
|
|
135
|
+
const baseStats: AlternativeStat[] = []
|
|
136
|
+
|
|
137
|
+
if (this.mass || this.mass === 0) {
|
|
138
|
+
if (this.mass === 1) {
|
|
139
|
+
baseStats.push({
|
|
140
|
+
metricLabel: 'Mass',
|
|
141
|
+
metricValue: this.mass,
|
|
142
|
+
metricUnit: 'gram'
|
|
143
|
+
})
|
|
144
|
+
} else if (this.mass === 1000) {
|
|
145
|
+
baseStats.push({
|
|
146
|
+
metricLabel: 'Mass',
|
|
147
|
+
metricValue: this.mass / 1000,
|
|
148
|
+
metricUnit: 'kilogram'
|
|
149
|
+
})
|
|
150
|
+
} else if (this.mass > 1000) {
|
|
151
|
+
baseStats.push({
|
|
152
|
+
metricLabel: 'Mass',
|
|
153
|
+
metricValue: this.mass / 1000,
|
|
154
|
+
metricUnit: 'kilograms'
|
|
155
|
+
})
|
|
156
|
+
} else {
|
|
157
|
+
baseStats.push({
|
|
158
|
+
metricLabel: 'Mass',
|
|
159
|
+
metricValue: this.mass,
|
|
160
|
+
metricUnit: 'grams'
|
|
161
|
+
})
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (this.height || this.height === 0) {
|
|
166
|
+
if (this.height === 1) {
|
|
167
|
+
baseStats.push({
|
|
168
|
+
metricLabel: 'Height',
|
|
169
|
+
metricValue: this.height,
|
|
170
|
+
metricUnit: 'meter'
|
|
171
|
+
})
|
|
172
|
+
} else if (this.height === 1000) {
|
|
173
|
+
baseStats.push({
|
|
174
|
+
metricLabel: 'Mass',
|
|
175
|
+
metricValue: this.height / 1000,
|
|
176
|
+
metricUnit: 'kilometer'
|
|
177
|
+
})
|
|
178
|
+
} else if (this.height > 1000) {
|
|
179
|
+
baseStats.push({
|
|
180
|
+
metricLabel: 'Mass',
|
|
181
|
+
metricValue: this.height / 1000,
|
|
182
|
+
metricUnit: 'kilometers'
|
|
183
|
+
})
|
|
184
|
+
} else {
|
|
185
|
+
baseStats.push({
|
|
186
|
+
metricLabel: 'Height',
|
|
187
|
+
metricValue: this.height,
|
|
188
|
+
metricUnit: 'meters'
|
|
189
|
+
})
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (this.speed || this.speed === 0) {
|
|
194
|
+
baseStats.push({
|
|
195
|
+
metricLabel: 'Speed',
|
|
196
|
+
metricValue: this.speed,
|
|
197
|
+
metricUnit: 'm/s'
|
|
198
|
+
})
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return baseStats.concat(this.alternativeStats)
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
methods: {
|
|
205
|
+
unitLabel(unit: MetricUnit): MetricUnitLabel | MetricUnit {
|
|
206
|
+
return metricUnits[unit] ?? unit
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
})
|
|
210
|
+
</script>
|
|
211
|
+
<style lang="scss">
|
|
212
|
+
.RoboticsDetailStats {
|
|
213
|
+
.label {
|
|
214
|
+
@apply font-semibold mb-4 text-jpl-red-dark;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
</style>
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="hasContent"
|
|
4
|
+
class="RoboticsDetailStatsMini text-gray-dark text-body-lg sm:flex sm:text-left text-center"
|
|
5
|
+
:class="allStats.length > 2 ? 'justify-between' : 'justify-start'"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
v-for="(stat, i) in allStats"
|
|
9
|
+
:key="i"
|
|
10
|
+
class="stat sm:mb-0 mb-6"
|
|
11
|
+
:class="allStats.length > 2 ? 'mr-0' : 'mr-16'"
|
|
12
|
+
>
|
|
13
|
+
<p class="text-subtitle text-gray-mid-dark mb-4">
|
|
14
|
+
{{ stat.metricLabel }}
|
|
15
|
+
</p>
|
|
16
|
+
<template
|
|
17
|
+
v-if="
|
|
18
|
+
(stat.metricUnit === 'gram' ||
|
|
19
|
+
stat.metricUnit === 'grams' ||
|
|
20
|
+
stat.metricUnit === 'kilogram' ||
|
|
21
|
+
stat.metricUnit === 'kilograms' ||
|
|
22
|
+
stat.metricUnit === 'meter' ||
|
|
23
|
+
stat.metricUnit === 'meters' ||
|
|
24
|
+
stat.metricUnit === 'kilometer' ||
|
|
25
|
+
stat.metricUnit === 'kilometers' ||
|
|
26
|
+
stat.metricUnit === 'm/s') &&
|
|
27
|
+
unitPair(stat.metricUnit)
|
|
28
|
+
"
|
|
29
|
+
>
|
|
30
|
+
<BaseUnitToggle
|
|
31
|
+
v-slot="slotProps"
|
|
32
|
+
:unit-pair="unitPair(stat.metricUnit)"
|
|
33
|
+
:value="parseFloat(stat.metricValue)"
|
|
34
|
+
:value-system="'metric'"
|
|
35
|
+
>
|
|
36
|
+
<span class="text-stats-xl">{{ slotProps.formattedValue }}</span>
|
|
37
|
+
</BaseUnitToggle>
|
|
38
|
+
</template>
|
|
39
|
+
<template v-else>
|
|
40
|
+
<div>
|
|
41
|
+
<p :class="{ 'text-stats-xl': !isNaN(stat.metricValue) }">
|
|
42
|
+
{{ stat.metricValue }}
|
|
43
|
+
</p>
|
|
44
|
+
<p class="text-body-xs text-gray-mid-dark pt-3 uppercase">
|
|
45
|
+
{{ unitLabel(stat.metricUnit) }}
|
|
46
|
+
</p>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
<script lang="ts">
|
|
53
|
+
// @ts-nocheck
|
|
54
|
+
import type { PropType } from 'vue'
|
|
55
|
+
import { defineComponent } from 'vue'
|
|
56
|
+
import {
|
|
57
|
+
metricUnits,
|
|
58
|
+
MetricUnit,
|
|
59
|
+
MetricUnitLabel,
|
|
60
|
+
AlternativeStat
|
|
61
|
+
} from './RoboticsDetailStats.vue'
|
|
62
|
+
import BaseUnitToggle from './../BaseUnitToggle/BaseUnitToggle.vue'
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Displays the first three robotics stats.
|
|
66
|
+
*/
|
|
67
|
+
export default defineComponent({
|
|
68
|
+
name: 'RoboticsDetailStatsMini',
|
|
69
|
+
components: {
|
|
70
|
+
BaseUnitToggle
|
|
71
|
+
},
|
|
72
|
+
props: {
|
|
73
|
+
mass: Number,
|
|
74
|
+
height: Number,
|
|
75
|
+
speed: Number,
|
|
76
|
+
alternativeStats: {
|
|
77
|
+
type: Array as PropType<AlternativeStat[]>,
|
|
78
|
+
required: true
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
computed: {
|
|
82
|
+
hasContent(): boolean {
|
|
83
|
+
return Boolean(this.allStats.length > 0)
|
|
84
|
+
},
|
|
85
|
+
allStats(): AlternativeStat[] {
|
|
86
|
+
const baseStats: AlternativeStat[] = []
|
|
87
|
+
|
|
88
|
+
if (this.mass || this.mass === 0) {
|
|
89
|
+
if (this.mass === 1) {
|
|
90
|
+
baseStats.push({
|
|
91
|
+
metricLabel: 'Mass',
|
|
92
|
+
metricValue: this.mass,
|
|
93
|
+
metricUnit: 'gram'
|
|
94
|
+
})
|
|
95
|
+
} else if (this.mass === 1000) {
|
|
96
|
+
baseStats.push({
|
|
97
|
+
metricLabel: 'Mass',
|
|
98
|
+
metricValue: this.mass / 1000,
|
|
99
|
+
metricUnit: 'kilogram'
|
|
100
|
+
})
|
|
101
|
+
} else if (this.mass >= 1000) {
|
|
102
|
+
baseStats.push({
|
|
103
|
+
metricLabel: 'Mass',
|
|
104
|
+
metricValue: this.mass / 1000,
|
|
105
|
+
metricUnit: 'kilograms'
|
|
106
|
+
})
|
|
107
|
+
} else {
|
|
108
|
+
baseStats.push({
|
|
109
|
+
metricLabel: 'Mass',
|
|
110
|
+
metricValue: this.mass,
|
|
111
|
+
metricUnit: 'grams'
|
|
112
|
+
})
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (this.height || this.height === 0) {
|
|
117
|
+
if (this.height === 1) {
|
|
118
|
+
baseStats.push({
|
|
119
|
+
metricLabel: 'Height',
|
|
120
|
+
metricValue: this.height,
|
|
121
|
+
metricUnit: 'meter'
|
|
122
|
+
})
|
|
123
|
+
} else if (this.height === 1000) {
|
|
124
|
+
baseStats.push({
|
|
125
|
+
metricLabel: 'Height',
|
|
126
|
+
metricValue: this.height / 1000,
|
|
127
|
+
metricUnit: 'kilometer'
|
|
128
|
+
})
|
|
129
|
+
} else if (this.height > 1000) {
|
|
130
|
+
baseStats.push({
|
|
131
|
+
metricLabel: 'Height',
|
|
132
|
+
metricValue: this.height / 1000,
|
|
133
|
+
metricUnit: 'kilometers'
|
|
134
|
+
})
|
|
135
|
+
} else {
|
|
136
|
+
baseStats.push({
|
|
137
|
+
metricLabel: 'Height',
|
|
138
|
+
metricValue: this.height,
|
|
139
|
+
metricUnit: 'meters'
|
|
140
|
+
})
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (this.speed || this.speed === 0) {
|
|
145
|
+
baseStats.push({
|
|
146
|
+
metricLabel: 'Speed',
|
|
147
|
+
metricValue: this.speed,
|
|
148
|
+
metricUnit: 'm/s'
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
// only return the first three stats
|
|
152
|
+
return baseStats.concat(this.alternativeStats).splice(0, 3)
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
methods: {
|
|
156
|
+
unitLabel(unit: MetricUnit): MetricUnitLabel | MetricUnit {
|
|
157
|
+
return metricUnits[unit] ?? unit
|
|
158
|
+
},
|
|
159
|
+
unitPair(unit: string): string | null {
|
|
160
|
+
if (unit === 'gram' || unit === 'grams') {
|
|
161
|
+
return 'G_OZ'
|
|
162
|
+
} else if (unit === 'kilogram' || unit === 'kilograms') {
|
|
163
|
+
return 'LB_KG'
|
|
164
|
+
} else if (unit === 'meter' || unit === 'meters') {
|
|
165
|
+
return 'M_FT'
|
|
166
|
+
} else if (unit === 'kilometer' || unit === 'kilometers') {
|
|
167
|
+
return 'MI_KM'
|
|
168
|
+
} else if (unit === 'm/s') {
|
|
169
|
+
return 'MS_FS'
|
|
170
|
+
}
|
|
171
|
+
return null
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
</script>
|
|
176
|
+
<style lang="scss">
|
|
177
|
+
.RoboticsDetailStatsMini {
|
|
178
|
+
> .stat {
|
|
179
|
+
min-width: 5ch;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
</style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import SearchFilterGroup from './SearchFilterGroup.vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/Search/SearchFilterGroup',
|
|
5
|
+
component: SearchFilterGroup,
|
|
6
|
+
excludeStories: /.*Data$/
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// template
|
|
10
|
+
const SearchFilterGroupTemplate = (args) => ({
|
|
11
|
+
props: Object.keys(args),
|
|
12
|
+
components: { SearchFilterGroup },
|
|
13
|
+
template: `<SearchFilterGroup
|
|
14
|
+
:filter-by="filterBy"
|
|
15
|
+
:buckets="buckets"
|
|
16
|
+
:group-key="groupKey"
|
|
17
|
+
:group-title="groupTitle"
|
|
18
|
+
:truncate-filters="truncateFilters"
|
|
19
|
+
/>`
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
export const TopicFilter = {
|
|
23
|
+
args: {
|
|
24
|
+
filterBy: [],
|
|
25
|
+
buckets: [
|
|
26
|
+
{ key: 'Solar System', doc_count: 3308 },
|
|
27
|
+
{ key: 'Earth', doc_count: 1179 },
|
|
28
|
+
{ key: 'Stars and Galaxies', doc_count: 979 },
|
|
29
|
+
{ key: 'Technology', doc_count: 480 }
|
|
30
|
+
],
|
|
31
|
+
groupKey: 'topics',
|
|
32
|
+
groupTitle: 'Topic',
|
|
33
|
+
truncateFilters: false
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export const DateFilter = {
|
|
37
|
+
args: {
|
|
38
|
+
filterBy: [],
|
|
39
|
+
buckets: [
|
|
40
|
+
{ key_as_string: '2021', key: 1609459200000, doc_count: 5 },
|
|
41
|
+
{ key_as_string: '2020', key: 1577836800000, doc_count: 231 },
|
|
42
|
+
{ key_as_string: '2019', key: 1546300800000, doc_count: 245 },
|
|
43
|
+
{ key_as_string: '2018', key: 1514764800000, doc_count: 276 },
|
|
44
|
+
{ key_as_string: '2017', key: 1483228800000, doc_count: 314 },
|
|
45
|
+
{ key_as_string: '2016', key: 1451606400000, doc_count: 311 },
|
|
46
|
+
{ key_as_string: '2015', key: 1420070400000, doc_count: 377 },
|
|
47
|
+
{ key_as_string: '2014', key: 1388534400000, doc_count: 418 },
|
|
48
|
+
{ key_as_string: '2013', key: 1356998400000, doc_count: 358 },
|
|
49
|
+
{ key_as_string: '2012', key: 1325376000000, doc_count: 389 },
|
|
50
|
+
{ key_as_string: '2011', key: 1293840000000, doc_count: 367 },
|
|
51
|
+
{ key_as_string: '2010', key: 1262304000000, doc_count: 389 },
|
|
52
|
+
{ key_as_string: '2009', key: 1230768000000, doc_count: 172 },
|
|
53
|
+
{ key_as_string: '2008', key: 1199145600000, doc_count: 227 }
|
|
54
|
+
],
|
|
55
|
+
groupKey: 'results_by_year',
|
|
56
|
+
groupTitle: 'Date',
|
|
57
|
+
truncateFilters: true
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="
|
|
4
|
+
typeof groupKey !== 'undefined' &&
|
|
5
|
+
typeof buckets !== 'undefined' &&
|
|
6
|
+
bucketsLength >= 1 &&
|
|
7
|
+
!hideFilterGroups.includes(groupKey)
|
|
8
|
+
"
|
|
9
|
+
:id="`filterGroup_${groupKey}`"
|
|
10
|
+
class="border-gray-light-mid col-span-3 pb-4 mb-4 border-b"
|
|
11
|
+
>
|
|
12
|
+
<!-- bucket key param -->
|
|
13
|
+
<legend class="md:mb-3 text-body-md mb-2 font-bold leading-normal tracking-wide">
|
|
14
|
+
{{ groupTitle }}
|
|
15
|
+
</legend>
|
|
16
|
+
<div
|
|
17
|
+
v-for="(bucket, index) in buckets"
|
|
18
|
+
:key="bucket.key"
|
|
19
|
+
ref="buckets"
|
|
20
|
+
class="form-group form-check"
|
|
21
|
+
>
|
|
22
|
+
<!-- correct for zero based index -->
|
|
23
|
+
<div
|
|
24
|
+
v-if="!truncateFilters || index <= checkbox.checkboxLimit - 1"
|
|
25
|
+
class="flex my-2"
|
|
26
|
+
>
|
|
27
|
+
<input
|
|
28
|
+
:id="bucket.key_as_string ? generateId(bucket.key_as_string) : generateId(bucket.key)"
|
|
29
|
+
v-model="filterByHandler"
|
|
30
|
+
type="checkbox"
|
|
31
|
+
:value="bucket.key_as_string ? bucket.key_as_string : bucket.key"
|
|
32
|
+
class="text-primary focus:ring-2 focus:ring-primary flex-shrink-0 w-5 h-5 mt-px mr-1 align-middle border rounded-none"
|
|
33
|
+
/>
|
|
34
|
+
<!-- 'key_as_string' exists for dates to have a human readable version -->
|
|
35
|
+
<label
|
|
36
|
+
:for="bucket.key_as_string ? generateId(bucket.key_as_string) : generateId(bucket.key)"
|
|
37
|
+
class="form-check-label pl-2 tracking-normal align-middle"
|
|
38
|
+
>
|
|
39
|
+
{{ prettyFilterNames(bucket.key_as_string ? bucket.key_as_string : bucket.key) }}
|
|
40
|
+
<span class="text-gray-mid"> ({{ bucket.doc_count.toLocaleString() }}) </span>
|
|
41
|
+
</label>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<!--
|
|
45
|
+
TODO: this logic could probably cleaner. It flows in the opposite way of the loop
|
|
46
|
+
for making checkboxes above.
|
|
47
|
+
only show button if we want to truncate the list and/or we're highter than limit
|
|
48
|
+
-->
|
|
49
|
+
|
|
50
|
+
<div v-show="truncateFilters && bucketsLength > checkbox.initialLimit">
|
|
51
|
+
<button
|
|
52
|
+
class="can-hover:hover:underline text-primary mt-2"
|
|
53
|
+
:aria-expanded="!checkbox.showMore ? 'true' : 'false'"
|
|
54
|
+
aria-haspopup="true"
|
|
55
|
+
:aria-controls="`filterGroup_${groupKey}`"
|
|
56
|
+
@click="toggleShowMoreFilters()"
|
|
57
|
+
>
|
|
58
|
+
{{ checkbox.showMore == false ? 'Less' : 'More' }}
|
|
59
|
+
</button>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
<script lang="ts">
|
|
64
|
+
// @ts-nocheck
|
|
65
|
+
import isEqual from 'lodash/isEqual'
|
|
66
|
+
export default {
|
|
67
|
+
name: 'SearchFilterGroup',
|
|
68
|
+
props: {
|
|
69
|
+
filterBy: Array,
|
|
70
|
+
buckets: null,
|
|
71
|
+
hideFilterGroups: {
|
|
72
|
+
type: Array,
|
|
73
|
+
default: () => []
|
|
74
|
+
},
|
|
75
|
+
groupKey: {
|
|
76
|
+
type: String,
|
|
77
|
+
required: true
|
|
78
|
+
},
|
|
79
|
+
groupTitle: {
|
|
80
|
+
type: String,
|
|
81
|
+
required: false
|
|
82
|
+
},
|
|
83
|
+
truncateFilters: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
required: false,
|
|
86
|
+
default: false
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
emits: ['update:filterBy'],
|
|
90
|
+
data() {
|
|
91
|
+
return {
|
|
92
|
+
checkbox: {
|
|
93
|
+
checkboxLimit: 4,
|
|
94
|
+
showMore: true,
|
|
95
|
+
initialLimit: 4
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
computed: {
|
|
100
|
+
// to sync both ways parent <--> child
|
|
101
|
+
// ensures accurate filter visual state when using URL query strings
|
|
102
|
+
filterByHandler: {
|
|
103
|
+
get() {
|
|
104
|
+
return this.filterBy
|
|
105
|
+
},
|
|
106
|
+
set(newValue) {
|
|
107
|
+
this.$emit('update:filterBy', newValue)
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
bucketsLength() {
|
|
111
|
+
return this.buckets.length
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
watch: {
|
|
115
|
+
filterBy: {
|
|
116
|
+
// update URL with filter parameters
|
|
117
|
+
handler(newVal, oldVal) {
|
|
118
|
+
// using lodash to avoid discrepancies between comparing nested objects and arrays
|
|
119
|
+
if (!isEqual(newVal, oldVal)) {
|
|
120
|
+
let query = Object.assign({}, this.$route.query)
|
|
121
|
+
if (newVal.length > 0) {
|
|
122
|
+
query = {
|
|
123
|
+
...this.$route.query,
|
|
124
|
+
[this.groupKey]: newVal.toString()
|
|
125
|
+
}
|
|
126
|
+
} else {
|
|
127
|
+
// clear the param from the URL if no value is passed
|
|
128
|
+
delete query[this.groupKey]
|
|
129
|
+
}
|
|
130
|
+
// using $router.push() ensures history is saved with each change to filters
|
|
131
|
+
this.$router.push({ query })
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
methods: {
|
|
137
|
+
generateId(value) {
|
|
138
|
+
let valueString = String(value)
|
|
139
|
+
valueString = valueString.split(' ').join('')
|
|
140
|
+
return `filter_${this.groupKey}_${valueString}`
|
|
141
|
+
},
|
|
142
|
+
toggleShowMoreFilters() {
|
|
143
|
+
if (this.checkbox.checkboxLimit === this.checkbox.initialLimit) {
|
|
144
|
+
this.checkbox.checkboxLimit = Infinity
|
|
145
|
+
this.checkbox.showMore = false
|
|
146
|
+
|
|
147
|
+
this.$nextTick(() => {
|
|
148
|
+
// Focus on first new rendered checkbox in list
|
|
149
|
+
this.$refs.buckets[this.checkbox.initialLimit].getElementsByTagName('input')[0].focus()
|
|
150
|
+
})
|
|
151
|
+
} else {
|
|
152
|
+
this.checkbox.checkboxLimit = this.checkbox.initialLimit
|
|
153
|
+
this.checkbox.showMore = true
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
prettyFilterNames(key) {
|
|
157
|
+
if (key === 'news.News') {
|
|
158
|
+
return 'News & Features'
|
|
159
|
+
}
|
|
160
|
+
if (key === 'home.HomePage') {
|
|
161
|
+
return 'Homepage'
|
|
162
|
+
}
|
|
163
|
+
if (key === 'missions.Mission') {
|
|
164
|
+
return 'Missions'
|
|
165
|
+
}
|
|
166
|
+
if (key === 'events.EventPage') {
|
|
167
|
+
return 'Events'
|
|
168
|
+
}
|
|
169
|
+
if (key === 'image_detail.ImageDetailPage') {
|
|
170
|
+
return 'Images'
|
|
171
|
+
}
|
|
172
|
+
if (key === 'audio_detail.AudioIndexPage') {
|
|
173
|
+
return 'Audio Index'
|
|
174
|
+
}
|
|
175
|
+
if (key === 'audio_detail.AudioDetailPage') {
|
|
176
|
+
return 'Audio'
|
|
177
|
+
}
|
|
178
|
+
if (key === 'infographics.InfographicsDetailPage') {
|
|
179
|
+
return 'Infographics'
|
|
180
|
+
}
|
|
181
|
+
if (key === 'image_detail.CuratedGalleryPage') {
|
|
182
|
+
return 'Curated Gallery'
|
|
183
|
+
}
|
|
184
|
+
if (key === 'topics.TopicPage') {
|
|
185
|
+
return 'Topics'
|
|
186
|
+
}
|
|
187
|
+
if (key === 'asteroid_watch.AsteroidWatchIndexPage') {
|
|
188
|
+
return 'Asteroid Watch Index'
|
|
189
|
+
}
|
|
190
|
+
if (key === 'asteroid_watch.AsteroidWatchContentPage') {
|
|
191
|
+
return 'Asteroid Watch'
|
|
192
|
+
}
|
|
193
|
+
if (key === 'missions.MissionsIndexPage') {
|
|
194
|
+
return 'Missions Index'
|
|
195
|
+
}
|
|
196
|
+
if (key === 'information_pages.ContentPage') {
|
|
197
|
+
return 'Information pages'
|
|
198
|
+
}
|
|
199
|
+
if (key === 'robotics.RobotPage') {
|
|
200
|
+
return 'Robots'
|
|
201
|
+
}
|
|
202
|
+
if (key === 'video_detail.VideoDetailPage') {
|
|
203
|
+
return 'Video'
|
|
204
|
+
}
|
|
205
|
+
if (key === 'podcasts.PodcastPage') {
|
|
206
|
+
return 'Podcasts'
|
|
207
|
+
}
|
|
208
|
+
if (key === 'go_pages.GoHomePage') {
|
|
209
|
+
return 'Go Sites'
|
|
210
|
+
}
|
|
211
|
+
if (key === 'press_kits.PressKitHomePage') {
|
|
212
|
+
return 'Press Kits'
|
|
213
|
+
}
|
|
214
|
+
if (key === 'profiles.ProfilePage') {
|
|
215
|
+
return 'People'
|
|
216
|
+
}
|
|
217
|
+
return key
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
</script>
|