@explorer-1/vue 0.3.4 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/package.json +2 -2
- package/src/components/AboutTheAuthor/AboutTheAuthor.stories.js +1 -1
- package/src/components/AboutTheAuthor/AboutTheAuthor.vue +9 -9
- package/src/components/AsteroidWatchWidget/AsteroidWatchWidget.stories.js +2 -7
- package/src/components/AsteroidWatchWidget/AsteroidWatchWidget.vue +5 -1
- package/src/components/BackToTop/BackToTop.stories.js +1 -1
- package/src/components/BackToTop/BackToTop.vue +10 -0
- package/src/components/BaseAccordionItem/BaseAccordionItem.stories.js +24 -4
- package/src/components/BaseAccordionItem/BaseAccordionItem.vue +56 -17
- package/src/components/BaseAudio/BaseAudio.stories.js +4 -6
- package/src/components/BaseAudio/BaseAudio.vue +6 -0
- package/src/components/BaseButton/BaseButton.stories.ts +12 -23
- package/src/components/BaseButton/BaseButton.vue +34 -10
- package/src/components/BaseCheckboxGroup/BaseCheckboxGroup.stories.js +2 -1
- package/src/components/BaseCheckboxGroup/BaseCheckboxGroup.vue +5 -0
- package/src/components/BaseHeading/BaseHeading.stories.js +9 -17
- package/src/components/BaseHeading/BaseHeading.vue +18 -8
- package/src/components/BaseImage/BaseImage.stories.ts +7 -17
- package/src/components/BaseImage/BaseImage.vue +26 -14
- package/src/components/BaseImageCaption/BaseImageCaption.stories.js +11 -0
- package/src/components/BaseImageCaption/BaseImageCaption.vue +10 -6
- package/src/components/BaseImagePlaceholder/BaseImagePlaceholder.stories.js +13 -15
- package/src/components/BaseImagePlaceholder/BaseImagePlaceholder.vue +13 -9
- package/src/components/BaseLink/BaseLink.stories.js +8 -7
- package/src/components/BaseLink/BaseLink.vue +32 -21
- package/src/components/BaseModal/BaseModal.stories.js +4 -7
- package/src/components/BaseModal/BaseModal.vue +1 -0
- package/src/components/BaseModal/BaseModalDialog.vue +1 -6
- package/src/components/BasePill/BasePill.stories.js +8 -22
- package/src/components/BasePill/BasePill.vue +36 -19
- package/src/components/BasePlaceholder/BasePlaceholder.stories.js +4 -7
- package/src/components/BasePlaceholder/BasePlaceholder.vue +1 -1
- package/src/components/BaseRadioGroup/BaseRadioGroup.stories.js +1 -0
- package/src/components/BaseRadioGroup/BaseRadioGroup.vue +9 -2
- package/src/components/BaseSwimlane/BaseSwimlane.stories.js +2 -1
- package/src/components/BaseSwimlane/BaseSwimlane.vue +2 -0
- package/src/components/BaseTimer/BaseTimer.stories.js +7 -2
- package/src/components/BaseTimer/BaseTimer.vue +4 -2
- package/src/components/BaseUnitToggle/BaseUnitToggle.stories.js +1 -16
- package/src/components/BaseUnitToggle/BaseUnitToggle.vue +4 -0
- package/src/components/BaseVideo/BaseVideo.vue +7 -3
- package/src/components/BlockAccordion/BlockAccordion.stories.js +4 -2
- package/src/components/BlockAccordion/BlockAccordion.vue +3 -3
- package/src/components/BlockAudio/BlockAudio.stories.js +1 -0
- package/src/components/BlockAudio/BlockAudio.vue +11 -3
- package/src/components/BlockCardGrid/BlockCardGrid.stories.js +1 -1
- package/src/components/BlockCardGrid/BlockCardGrid.vue +1 -1
- package/src/components/BlockCardGridItem/BlockCardGridItem.stories.js +3 -3
- package/src/components/BlockCardGridItem/BlockCardGridItemElement.vue +1 -1
- package/src/components/BlockCircleImageCard/BlockCircleImageCard.stories.js +3 -9
- package/src/components/BlockCsrTable/BlockCsrTable.stories.js +1 -0
- package/src/components/BlockCsrTable/BlockCsrTable.vue +1 -1
- package/src/components/BlockCta/BlockCta.stories.js +1 -0
- package/src/components/BlockCta/BlockCta.vue +9 -2
- package/src/components/BlockDialog/BlockDialog.stories.js +2 -1
- package/src/components/BlockGist/BlockGist.stories.js +3 -2
- package/src/components/BlockGist/BlockGist.vue +8 -6
- package/src/components/BlockHeading/BlockHeading.stories.js +1 -0
- package/src/components/BlockIframeEmbed/BlockIframeEmbed.stories.js +3 -2
- package/src/components/BlockIframeEmbed/BlockIframeEmbed.vue +9 -2
- package/src/components/BlockImage/BlockImage.stories.js +1 -5
- package/src/components/BlockImage/BlockImage.vue +5 -2
- package/src/components/BlockImageCarousel/BlockImageCarousel.stories.js +3 -15
- package/src/components/BlockImageCarousel/BlockImageCarousel.vue +2 -0
- package/src/components/BlockImageCarouselItem/BlockImageCarouselItem.stories.js +2 -16
- package/src/components/BlockImageCarouselItem/BlockImageCarouselItem.vue +7 -7
- package/src/components/BlockImageComparison/BlockImageComparison.stories.js +5 -3
- package/src/components/BlockImageComparison/BlockImageComparison.vue +11 -2
- package/src/components/BlockImageGallery/BlockImageGallery.stories.js +4 -11
- package/src/components/BlockImageGallery/BlockImageGallery.vue +5 -0
- package/src/components/BlockInlineImage/BlockInlineImage.stories.js +5 -2
- package/src/components/BlockInlineImage/BlockInlineImage.vue +20 -7
- package/src/components/BlockKeyPoints/BlockKeyPoints.stories.js +1 -0
- package/src/components/BlockKeyPoints/BlockKeyPoints.vue +12 -3
- package/src/components/BlockLinkCard/BlockLinkCard.stories.js +24 -34
- package/src/components/BlockLinkCard/BlockLinkCard.vue +28 -9
- package/src/components/BlockLinkCard/BlockLinkCardCollectionLg.vue +2 -2
- package/src/components/BlockLinkCardList/BlockLinkCardList.stories.js +1 -3
- package/src/components/BlockLinkCarousel/BlockLinkCarousel.stories.js +2 -14
- package/src/components/BlockLinkCarousel/BlockLinkCarousel.vue +8 -8
- package/src/components/BlockLinkTile/BlockLinkTile.stories.js +3 -13
- package/src/components/BlockLinkTile/BlockLinkTile.vue +26 -13
- package/src/components/BlockListCards/BlockListCards.stories.js +1 -0
- package/src/components/BlockListCards/BlockListCards.vue +5 -4
- package/src/components/BlockNewsletterSignup/BlockNewsletterSignup.stories.js +1 -0
- package/src/components/BlockNewsletterSignup/BlockNewsletterSignup.vue +3 -2
- package/src/components/BlockQuote/BlockQuote.stories.js +1 -0
- package/src/components/BlockQuote/BlockQuote.vue +3 -2
- package/src/components/BlockRelatedLinks/BlockRelatedLinks.stories.js +1 -0
- package/src/components/BlockRelatedLinks/BlockRelatedLinks.vue +6 -4
- package/src/components/BlockRichTable/BlockRichTable.stories.js +1 -1
- package/src/components/BlockRichTable/BlockRichTable.vue +23 -9
- package/src/components/BlockStreamfield/BlockStreamfield.stories.js +1 -11
- package/src/components/BlockStreamfield/BlockStreamfield.vue +34 -31
- package/src/components/BlockTeaser/BlockTeaser.stories.js +1 -0
- package/src/components/BlockTeaser/BlockTeaser.vue +20 -12
- package/src/components/BlockText/BlockText.stories.js +2 -9
- package/src/components/BlockText/BlockText.vue +21 -9
- package/src/components/BlockVideo/BlockVideo.stories.js +1 -0
- package/src/components/BlockVideo/BlockVideo.vue +14 -3
- package/src/components/BlockVideoEmbed/BlockVideoEmbed.stories.js +1 -0
- package/src/components/BlockVideoEmbed/BlockVideoEmbed.vue +6 -3
- package/src/components/CalendarButton/CalendarButton.vue +7 -0
- package/src/components/DetailHeadline/DetailHeadline.stories.js +2 -20
- package/src/components/DetailHeadline/DetailHeadline.vue +16 -4
- package/src/components/DsnWidget/DsnWidget.stories.js +2 -6
- package/src/components/DsnWidget/DsnWidget.vue +18 -4
- package/src/components/EventDetailHero/EventDetailHero.stories.js +10 -7
- package/src/components/EventDetailHero/EventDetailHero.vue +4 -7
- package/src/components/FormContact/FormContact.stories.js +2 -1
- package/src/components/FormNewsletterSignup/FormNewsletterSignup.stories.js +2 -1
- package/src/components/HeroInlineMedia/HeroInlineMedia.vue +12 -8
- package/src/components/HeroLarge/HeroLarge.stories.js +27 -2
- package/src/components/HeroLarge/HeroLarge.vue +12 -5
- package/src/components/HeroListingIndex/HeroListingIndex.stories.js +1 -0
- package/src/components/HeroListingIndex/HeroListingIndex.vue +18 -13
- package/src/components/HeroMedia/HeroMedia.stories.js +14 -9
- package/src/components/HeroMedia/HeroMedia.vue +9 -8
- package/src/components/HeroMedium/HeroMedium.stories.js +19 -4
- package/src/components/HeroMedium/HeroMedium.vue +32 -14
- package/src/components/HeroMedium/HeroSmall.stories.js +20 -6
- package/src/components/HomepageCarousel/HomepageCarousel.stories.js +1 -1
- package/src/components/HomepageCarouselItem/HomepageCarouselItem.stories.js +2 -2
- package/src/components/HomepageCarouselItem/HomepageCarouselItem.vue +2 -6
- package/src/components/HomepageEmbedBlock/HomepageEmbedBlock.vue +2 -2
- package/src/components/LogoCaltech/LogoCaltech.stories.js +14 -18
- package/src/components/LogoCaltech/LogoCaltech.vue +1 -0
- package/src/components/LogoTribrand/LogoTribrand.stories.js +66 -51
- package/src/components/LogoTribrand/LogoTribrand.vue +4 -2
- package/src/components/MetaPanel/MetaPanel.stories.js +5 -9
- package/src/components/MetaPanel/MetaPanel.vue +3 -0
- package/src/components/MetaPanelItems/MetaPanelItems.stories.js +9 -2
- package/src/components/MetaPanelItems/MetaPanelItems.vue +2 -0
- package/src/components/MetadataEduResource/MetadataEduResource.stories.js +12 -10
- package/src/components/MetadataEduResource/MetadataEduResource.vue +7 -3
- package/src/components/MetadataEvent/MetadataEvent.stories.js +1 -1
- package/src/components/MissionDetailAbout/MissionDetailAbout.vue +1 -1
- package/src/components/MissionDetailHero/MissionDetailHero.stories.js +2 -2
- package/src/components/MissionDetailHighlights/MissionDetailHighlights.stories.js +1 -0
- package/src/components/MissionDetailInlineImage/MissionDetailInlineImage.stories.js +1 -6
- package/src/components/MissionDetailInlineImage/MissionDetailInlineImage.vue +10 -5
- package/src/components/MissionDetailStats/DistanceStats.vue +10 -5
- package/src/components/MissionDetailStats/MissionDetailStats.stories.js +4 -21
- package/src/components/MissionDetailStats/MissionDetailStats.vue +21 -5
- package/src/components/MissionDetailStreamfield/MissionDetailStreamfield.vue +4 -2
- package/src/components/MixinAnimationCaret/MixinAnimationCaret.stories.ts +7 -0
- package/src/components/MixinAnimationCaret/MixinAnimationCaret.vue +12 -6
- package/src/components/MixinCarousel/MixinCarousel.stories.js +2 -8
- package/src/components/MixinCarousel/MixinCarousel.vue +13 -16
- package/src/components/MixinVideoBg/MixinVideoBg.stories.js +1 -1
- package/src/components/MixinVideoBg/MixinVideoBg.vue +4 -7
- package/src/components/NavDesktop/NavDesktop.stories.js +1 -0
- package/src/components/NavDesktop/NavDesktop.vue +4 -4
- package/src/components/NavDesktop/NavDesktopTopHat.vue +4 -4
- package/src/components/NavDesktopEdu/NavDesktopEdu.stories.js +1 -5
- package/src/components/NavDesktopEdu/NavDesktopEdu.vue +4 -4
- package/src/components/NavHeading/NavHeading.stories.js +3 -2
- package/src/components/NavHighlight/NavHighlight.stories.js +3 -2
- package/src/components/NavJumpMenu/NavJumpMenu.stories.js +5 -2
- package/src/components/NavLinkList/NavLinkList.stories.js +3 -2
- package/src/components/NavLinkList/NavLinkList.vue +3 -3
- package/src/components/NavLogoLinks/NavLogoLinks.stories.js +1 -0
- package/src/components/NavMobile/NavMobile.stories.js +13 -2
- package/src/components/NavMobile/NavMobile.vue +18 -5
- package/src/components/NavMobile/NavMobileDropdown.vue +2 -2
- package/src/components/NavMobile/NavMobileEdu.stories.js +11 -4
- package/src/components/NavMobile/NavMobileLink.vue +4 -4
- package/src/components/NavSearchForm/NavSearchForm.stories.js +1 -0
- package/src/components/NavSecondary/NavSecondary.stories.js +1 -0
- package/src/components/NavSecondary/NavSecondary.vue +7 -4
- package/src/components/NavSecondary/NavSecondaryDropdownContent.vue +1 -1
- package/src/components/NavSocial/NavSocial.stories.js +1 -0
- package/src/components/NewsDetailMediaContact/NewsDetailMediaContact.stories.js +2 -1
- package/src/components/NewsDetailMediaContact/NewsDetailMediaContact.vue +1 -1
- package/src/components/ParallaxContainer/ParallaxContainer.stories.js +2 -2
- package/src/components/ParallaxContainer/ParallaxContainer.vue +1 -0
- package/src/components/PodcastSeriesCarousel/PodcastSeriesCarousel.vue +6 -5
- package/src/components/RoboticsDetailStats/RoboticsDetailStats.stories.js +3 -8
- package/src/components/SearchFilterGroup/SearchFilterGroup.stories.js +1 -0
- package/src/components/SearchInput/SearchInput.stories.js +1 -0
- package/src/components/SearchPagination/SearchPagination.stories.js +1 -0
- package/src/components/SearchResultCard/SearchResultCard.stories.js +1 -10
- package/src/components/SearchResultCard/SearchResultCard.vue +1 -0
- package/src/components/SearchResultGridItem/SearchResultGridItem.stories.js +3 -12
- package/src/components/SearchResultGridItem/SearchResultGridItem.vue +5 -2
- package/src/components/SearchResultsList/SearchResultsList.stories.js +3 -3
- package/src/components/SearchSelectMenu/SearchSelectMenu.stories.js +2 -1
- package/src/components/SwimlaneCTA/SwimlaneCTA.vue +1 -0
- package/src/components/TextArea/TextArea.stories.js +2 -1
- package/src/components/TextInput/TextInput.stories.js +2 -1
- package/src/components/TheFooter/TheFooter.stories.js +1 -0
- package/src/components/TheFooter/TheFooter.vue +30 -4
- package/src/components/ThumbnailCarousel/ThumbnailCarousel.stories.js +1 -1
- package/src/components/ThumbnailCarousel/ThumbnailCarousel.vue +2 -1
- package/src/components/TimelineDialog/TimelineDialog.vue +2 -2
- package/src/components/TopicDetailMissionCarousel/TopicDetailMissionCarousel.stories.js +1 -0
- package/src/components/TopicDetailMissionCarouselItem/TopicDetailMissionCarouselItem.stories.js +2 -2
- package/src/components/TopicDetailMore/TopicDetailMore.stories.js +1 -0
- package/src/components/TopicDetailMoreItem/TopicDetailMoreItem.stories.js +3 -2
- package/src/components/TopicDetailStreamfield/TopicDetailStreamfield.vue +2 -2
- package/src/constants.ts +3 -5
- package/src/docs/foundation/grid_layouthelpers.stories.js +2 -2
- package/src/docs/introduction.docs.mdx +14 -2
- package/src/interfaces.ts +31 -6
- package/src/templates/PageAudioDetail/PageAudioDetail.vue +2 -2
- package/src/templates/PageContent/PageContent.stories.js +1 -1
- package/src/templates/PageEventDetail/PageEventDetail.stories.js +1 -1
- package/src/templates/PageNewsDetail/PageNewsDetail.stories.js +2 -2
- package/src/templates/edu/PageContentEdu.stories.js +2 -2
- package/src/templates/edu/PageEduCollectionsDetail/PageEduCollectionsDetail.stories.js +2 -2
- package/src/templates/edu/PageEduEventDetail/PageEduEventDetail.stories.js +1 -1
- package/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.stories.js +2 -2
- package/src/templates/edu/PageEduGalleryDetail/PageEduGalleryDetail.stories.js +1 -1
- package/src/templates/edu/PageEduGalleryDetail/PageEduGalleryDetail.vue +10 -6
- package/src/templates/edu/PageEduHome/PageEduHome.stories.js +1 -1
- package/src/templates/edu/PageEduLesson/PageEduLesson.stories.js +2 -2
- package/src/templates/edu/PageEduMultimediaDetail/PageEduMultimediaDetail.stories.js +1 -1
- package/src/templates/edu/PageEduNewsDetail/PageEduNewsDetail.stories.js +2 -2
- package/src/templates/edu/PageEduStudentProject/PageEduStudentProject.stories.js +2 -2
- package/src/templates/edu/PageEduStudentProject/PageEduStudentProjectSection.vue +10 -6
- package/src/templates/edu/PageEduTeachableMoment/PageEduTeachableMoment.stories.js +2 -2
- package/src/templates/www/PageAsteroidWatchContent/PageAsteroidWatchContent.stories.js +2 -2
- package/src/templates/www/PageAsteroidWatchIndex/PageAsteroidWatchIndex.stories.js +2 -2
- package/src/templates/www/PageGoDirectory/PageGoDirectory.stories.js +2 -2
- package/src/templates/www/PageHomepage/PageHomepage.stories.js +2 -2
- package/src/templates/www/PageMissionDetail/PageMissionDetail.stories.js +2 -2
- package/src/templates/www/PagePodcast/PagePodcast.stories.js +2 -2
- package/src/templates/www/PagePodcastSeason/PagePodcastSeason.stories.js +2 -2
- package/src/templates/www/PagePressKitIndex/PagePressKitIndex.stories.js +2 -2
- package/src/templates/www/PageProfileDetail/PageProfileDetail.stories.js +2 -2
- package/src/templates/www/PageRoboticsDetail/PageRoboticsDetail.stories.js +2 -2
- package/src/templates/www/PageTimeline/PageTimeline.stories.js +2 -2
- package/src/templates/www/PageTopicDetail/PageTopicDetail.stories.js +2 -2
- package/src/templates/www/PageTopicDetail/PageTopicDetail.vue +2 -1
- package/src/utils/mixins.ts +7 -7
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
import BaseImage
|
|
1
|
+
import BaseImage from './BaseImage.vue'
|
|
2
2
|
export default {
|
|
3
3
|
title: 'Components/Base/BaseImage',
|
|
4
4
|
component: BaseImage,
|
|
5
5
|
excludeStories: /.*Data$/,
|
|
6
|
-
argTypes: {
|
|
7
|
-
objectFitClass: {
|
|
8
|
-
description:
|
|
9
|
-
'Use Tailwind CSS object fit classes to specify how the image will scale within `BaseImagePlaceholder`',
|
|
10
|
-
control: { type: 'select' },
|
|
11
|
-
options: Object.keys(objectFitClasses)
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
6
|
parameters: {
|
|
15
7
|
docs: {
|
|
16
8
|
description: {
|
|
17
9
|
component:
|
|
18
10
|
'The BaseImage component is a simple `<img />` tag wrapped in a `<div>` and is used to render an image with object-fit classes and lazy loading properties.'
|
|
19
11
|
}
|
|
12
|
+
},
|
|
13
|
+
html: {
|
|
14
|
+
root: '#storyRoot'
|
|
20
15
|
}
|
|
21
16
|
}
|
|
22
17
|
}
|
|
@@ -33,7 +28,7 @@ export const BaseImageData = {
|
|
|
33
28
|
// stories
|
|
34
29
|
export const BaseStory = {
|
|
35
30
|
args: BaseImageData,
|
|
36
|
-
decorators: [() => ({ template: '<div class="max-w-full"><story /></div>' })]
|
|
31
|
+
decorators: [() => ({ template: '<div id="storyRoot" class="max-w-full"><story /></div>' })]
|
|
37
32
|
}
|
|
38
33
|
|
|
39
34
|
export const LazyLoading = {
|
|
@@ -41,12 +36,7 @@ export const LazyLoading = {
|
|
|
41
36
|
decorators: [
|
|
42
37
|
() => ({
|
|
43
38
|
template:
|
|
44
|
-
'<div class="max-w-full"><div style="height:3500px">Scroll down and watch the network tab ⬇️</div><div id="
|
|
39
|
+
'<div class="max-w-full"><div style="height:3500px">Scroll down and watch the network tab ⬇️</div><div id="storyDecorator"><story /></div></div>'
|
|
45
40
|
})
|
|
46
|
-
]
|
|
47
|
-
parameters: {
|
|
48
|
-
html: {
|
|
49
|
-
root: '#storyRoot'
|
|
50
|
-
}
|
|
51
|
-
}
|
|
41
|
+
]
|
|
52
42
|
}
|
|
@@ -1,52 +1,64 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The BaseImage component is a simple `<img />` tag wrapped in a `<div>`
|
|
4
|
+
* and is used to render an image with object-fit classes and lazy loading properties.
|
|
5
|
+
*/
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
import { defineComponent, type PropType } from 'vue'
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const objectFitClasses: ObjectFitClasses = {
|
|
9
|
+
type ImageLoader = 'lazy' | 'eager' | undefined
|
|
10
|
+
const objectFitClasses = {
|
|
12
11
|
none: 'object-none',
|
|
13
12
|
contain: 'object-contain',
|
|
14
13
|
cover: 'object-cover',
|
|
15
14
|
fill: 'object-fill',
|
|
16
15
|
scaleDown: 'object-scale-down'
|
|
17
|
-
}
|
|
16
|
+
} as const
|
|
17
|
+
type ObjectFitClassesKey = keyof typeof objectFitClasses
|
|
18
18
|
|
|
19
19
|
export default defineComponent({
|
|
20
20
|
name: 'BaseImage',
|
|
21
21
|
props: {
|
|
22
|
+
/** CSS classes to apply directory to the `<img>` element */
|
|
22
23
|
imageClass: {
|
|
23
24
|
type: String,
|
|
24
|
-
required: false
|
|
25
|
+
required: false,
|
|
26
|
+
default: ''
|
|
25
27
|
},
|
|
28
|
+
/** Tailwind CSS object fit classes to specify how the image will scale within `BaseImagePlaceholder` */
|
|
26
29
|
objectFitClass: {
|
|
27
|
-
type: String
|
|
30
|
+
type: String as PropType<ObjectFitClassesKey>,
|
|
28
31
|
required: false,
|
|
29
32
|
default: 'contain',
|
|
30
33
|
validator: (prop: string): boolean => Object.keys(objectFitClasses).includes(prop)
|
|
31
34
|
},
|
|
35
|
+
/** `<img> src` attribute */
|
|
32
36
|
src: {
|
|
33
37
|
type: String,
|
|
34
38
|
required: true
|
|
35
39
|
},
|
|
40
|
+
/** `<img> srcset` attribute */
|
|
36
41
|
srcset: {
|
|
37
42
|
type: String,
|
|
38
43
|
required: false,
|
|
39
44
|
default: ''
|
|
40
45
|
},
|
|
46
|
+
/** `<img> alt` attribute */
|
|
41
47
|
alt: {
|
|
42
|
-
type: String
|
|
48
|
+
type: String,
|
|
49
|
+
default: ''
|
|
43
50
|
},
|
|
51
|
+
/** `<img> width` attribute */
|
|
44
52
|
width: {
|
|
45
|
-
type: [Number, String]
|
|
53
|
+
type: [Number, String],
|
|
54
|
+
default: ''
|
|
46
55
|
},
|
|
56
|
+
/** `<img> height` attribute */
|
|
47
57
|
height: {
|
|
48
|
-
type: [Number, String]
|
|
58
|
+
type: [Number, String],
|
|
59
|
+
default: ''
|
|
49
60
|
},
|
|
61
|
+
/** `<img> loading` attribute */
|
|
50
62
|
loading: {
|
|
51
63
|
type: String as PropType<ImageLoader>,
|
|
52
64
|
required: false,
|
|
@@ -9,6 +9,17 @@ export default {
|
|
|
9
9
|
component: 'Caption text used with both images and videos.'
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
+
},
|
|
13
|
+
argTypes: {
|
|
14
|
+
customLink: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
description:
|
|
17
|
+
'Appends a link to the end of the caption. Overrides "Full Image Details" link, if it exists.'
|
|
18
|
+
},
|
|
19
|
+
customLinkText: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'Text for the custom link.'
|
|
22
|
+
}
|
|
12
23
|
}
|
|
13
24
|
}
|
|
14
25
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type
|
|
2
|
+
/** Caption text used with both images and videos. */
|
|
3
|
+
|
|
4
|
+
import { defineComponent, type PropType } from 'vue'
|
|
5
|
+
import type { ImageObject, VideoObject } from '../../interfaces'
|
|
5
6
|
import BaseLink from './../BaseLink/BaseLink.vue'
|
|
6
7
|
|
|
7
8
|
export default defineComponent({
|
|
@@ -10,15 +11,18 @@ export default defineComponent({
|
|
|
10
11
|
BaseLink
|
|
11
12
|
},
|
|
12
13
|
props: {
|
|
14
|
+
/** `{ImageObject}` data */
|
|
13
15
|
data: {
|
|
14
|
-
type: Object as PropType
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
// type: Object as PropType<<PartialImageObject>>,
|
|
17
|
+
type: Object as PropType<Partial<ImageObject> | Partial<VideoObject> | any>,
|
|
18
|
+
required: true
|
|
17
19
|
},
|
|
20
|
+
/** Appends a link to the end of the caption. Overrides "Full Image Details" link, if it exists. */
|
|
18
21
|
customLink: {
|
|
19
22
|
type: String,
|
|
20
23
|
default: undefined
|
|
21
24
|
},
|
|
25
|
+
/** Text for the custom link. Does not appear if `customLink` is blank */
|
|
22
26
|
customLinkText: {
|
|
23
27
|
type: String,
|
|
24
28
|
default: 'Custom Link'
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import BaseImage from './../BaseImage/BaseImage.vue'
|
|
2
|
-
import BaseImagePlaceholder
|
|
2
|
+
import BaseImagePlaceholder from './BaseImagePlaceholder.vue'
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Components/Base/BaseImagePlaceholder',
|
|
5
5
|
component: BaseImagePlaceholder,
|
|
6
6
|
excludeStories: /.*Data$/,
|
|
7
7
|
decorators: () => ({
|
|
8
|
-
template: '<div class="w-
|
|
8
|
+
template: '<div id="storyRoot" class="w-3/4"><story /></div>'
|
|
9
9
|
}),
|
|
10
10
|
tags: ['autodocs'],
|
|
11
11
|
parameters: {
|
|
@@ -16,21 +16,14 @@ export default {
|
|
|
16
16
|
template: `<BaseImage :object-fit-class="args.BaseImageProps.objectFitClass" :loading="args.BaseImageProps.loading" :src="args.BaseImageProps.src" :srcset="args.BaseImageProps.srcset" :alt="args.BaseImageProps.alt" :width="args.BaseImageProps.width" :height="args.BaseImageProps.height" />`
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
|
+
html: {
|
|
20
|
+
root: '#storyRoot'
|
|
21
|
+
},
|
|
19
22
|
docs: {
|
|
20
23
|
description: {
|
|
21
|
-
component:
|
|
22
|
-
'Aspect ratio CSS class. View dropdown to see all options. More classes can be added in `/src/scss/_aspect-ratios.scss`'
|
|
24
|
+
component: 'Placeholder image component with aspect ratio and background controls'
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
|
-
},
|
|
26
|
-
argTypes: {
|
|
27
|
-
aspectRatio: {
|
|
28
|
-
control: { type: 'select' },
|
|
29
|
-
options: Object.keys(aspectRatios)
|
|
30
|
-
},
|
|
31
|
-
responsiveAspectRatio: {
|
|
32
|
-
control: { type: 'text' }
|
|
33
|
-
}
|
|
34
27
|
}
|
|
35
28
|
}
|
|
36
29
|
|
|
@@ -38,7 +31,8 @@ export default {
|
|
|
38
31
|
export const BaseImagePlaceholderData = {
|
|
39
32
|
aspectRatio: '12:9',
|
|
40
33
|
darkMode: true,
|
|
41
|
-
transparentMode: false
|
|
34
|
+
transparentMode: false,
|
|
35
|
+
noLogo: false
|
|
42
36
|
}
|
|
43
37
|
|
|
44
38
|
export const WithImage = {
|
|
@@ -60,6 +54,7 @@ export const BaseStory = {
|
|
|
60
54
|
name: 'No Image',
|
|
61
55
|
args: {
|
|
62
56
|
...BaseImagePlaceholderData,
|
|
57
|
+
|
|
63
58
|
BaseImageProps: {
|
|
64
59
|
src: '',
|
|
65
60
|
srcset: '',
|
|
@@ -68,6 +63,9 @@ export const BaseStory = {
|
|
|
68
63
|
height: '',
|
|
69
64
|
objectFitClass: 'scaleDown',
|
|
70
65
|
loading: ''
|
|
71
|
-
}
|
|
66
|
+
},
|
|
67
|
+
noLogo: false,
|
|
68
|
+
aspectRatio: '16:9',
|
|
69
|
+
responsiveAspectRatio: 'md:aspect-ratio-four-three lg:aspect-ratio-twelve-nine'
|
|
72
70
|
}
|
|
73
71
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { defineComponent } from 'vue'
|
|
2
|
+
import { defineComponent, type PropType } from 'vue'
|
|
3
|
+
/** Placeholder image component with aspect ratio and background controls */
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
[key: string]: string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const aspectRatios: AspectRatios = {
|
|
5
|
+
export const aspectRatios = {
|
|
9
6
|
none: 'aspect-ratio-none',
|
|
10
7
|
portrait: 'aspect-ratio-four-five',
|
|
11
8
|
square: 'aspect-ratio-square',
|
|
@@ -22,33 +19,40 @@ export const aspectRatios: AspectRatios = {
|
|
|
22
19
|
'16:7': 'aspect-ratio-sixteen-seven',
|
|
23
20
|
'16:9': 'aspect-ratio-sixteen-nine',
|
|
24
21
|
'21:9': 'aspect-ratio-twentyone-nine'
|
|
25
|
-
}
|
|
22
|
+
} as const
|
|
23
|
+
type AspectRatiosKey = keyof typeof aspectRatios
|
|
26
24
|
|
|
27
25
|
export default defineComponent({
|
|
28
26
|
name: 'BaseImagePlaceholder',
|
|
29
27
|
props: {
|
|
28
|
+
/** If the placeholder background should be dark */
|
|
30
29
|
darkMode: {
|
|
31
30
|
type: Boolean,
|
|
32
31
|
required: false,
|
|
33
32
|
default: true
|
|
34
33
|
},
|
|
34
|
+
/** If the placeholder background should be transparent (ovverrides `darkMode`) */
|
|
35
35
|
transparentMode: {
|
|
36
36
|
type: Boolean,
|
|
37
37
|
required: false,
|
|
38
38
|
default: false
|
|
39
39
|
},
|
|
40
|
+
/** If the JPL logo should not appear in the background of the placeholder */
|
|
40
41
|
noLogo: {
|
|
41
42
|
type: Boolean,
|
|
42
43
|
default: false
|
|
43
44
|
},
|
|
45
|
+
/** Desired aspect ratio of image. If the contained image doesn't match, it will be adjusted to fit within the selected aspect ratio */
|
|
44
46
|
aspectRatio: {
|
|
45
|
-
type: String
|
|
47
|
+
type: String as PropType<AspectRatiosKey>,
|
|
46
48
|
default: 'none',
|
|
47
49
|
validator: (prop: string): boolean => Object.keys(aspectRatios).includes(prop)
|
|
48
50
|
},
|
|
51
|
+
/** Custom tailwind classes to combine screen-size directives with aspect ratios.
|
|
52
|
+
* Example: `md:aspect-ratio-four-three lg:aspect-ratio-twelve-nine`. Overrides `aspectRatio` setting. */
|
|
49
53
|
responsiveAspectRatio: {
|
|
50
54
|
type: String,
|
|
51
|
-
|
|
55
|
+
default: ''
|
|
52
56
|
}
|
|
53
57
|
},
|
|
54
58
|
computed: {
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import BaseLink
|
|
1
|
+
import BaseLink from './BaseLink.vue'
|
|
2
2
|
export default {
|
|
3
3
|
title: 'Components/Base/BaseLink',
|
|
4
4
|
component: BaseLink,
|
|
5
5
|
parameters: {
|
|
6
6
|
slots: {
|
|
7
|
-
default: '
|
|
7
|
+
default: 'Text or markup contained in the link'
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
10
|
argTypes: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
// JSDoc comments for these events aren't working, so we're setting them here
|
|
12
|
+
linkClicked: {
|
|
13
|
+
description: 'Click event emitted at the root-level (globally available)'
|
|
14
|
+
},
|
|
15
|
+
specificLinkClicked: {
|
|
16
|
+
description: 'Locally emitted click event (includes event attributes)'
|
|
14
17
|
}
|
|
15
18
|
},
|
|
16
19
|
excludeStories: /.*Data$/
|
|
@@ -21,8 +24,6 @@ export const BaseLinkData = {
|
|
|
21
24
|
variant: 'primary',
|
|
22
25
|
to: '/',
|
|
23
26
|
href: '/',
|
|
24
|
-
caret: false,
|
|
25
|
-
caretColor: 'text-primary',
|
|
26
27
|
default: 'Link Text'
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { defineComponent } from 'vue'
|
|
2
|
+
import { defineComponent, type PropType } from 'vue'
|
|
3
3
|
import { mapStores } from 'pinia'
|
|
4
4
|
import { useThemeStore } from '../../store/theme'
|
|
5
5
|
import { eventBus } from './../../utils/eventBus'
|
|
6
6
|
import MixinAnimationCaret from './../MixinAnimationCaret/MixinAnimationCaret.vue'
|
|
7
7
|
import { isEduExternalLink } from './../../utils/isEduExternalLink'
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[key: string]: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const variants: Variants = {
|
|
9
|
+
const variants = {
|
|
14
10
|
primary: 'text-subtitle text-action can-hover:hover:text-action-dark',
|
|
15
11
|
secondary: 'text-subtitle text-action can-hover:hover:text-action-dark',
|
|
16
12
|
default: '-default underline text-action can-hover:hover:text-action-dark',
|
|
17
13
|
none: ''
|
|
18
|
-
}
|
|
19
|
-
|
|
14
|
+
} as const
|
|
15
|
+
type VariantsKey = keyof typeof variants
|
|
16
|
+
|
|
17
|
+
const primaryColorVariants = {
|
|
20
18
|
primary: 'text-subtitle text-primary can-hover:hover:text-primary-dark',
|
|
21
19
|
secondary: 'text-subtitle text-primary can-hover:hover:text-primary-dark',
|
|
22
20
|
default: '-default underline text-primary can-hover:hover:text-primary-dark',
|
|
23
21
|
none: ''
|
|
24
|
-
}
|
|
22
|
+
} as const
|
|
25
23
|
|
|
26
24
|
export default defineComponent({
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
/** this component is useful when you need a link that can either be an 'a' or router link.
|
|
26
|
+
* falls back to a <div> if no url is provided
|
|
27
|
+
*/
|
|
29
28
|
name: 'BaseLink',
|
|
30
29
|
components: {
|
|
31
30
|
MixinAnimationCaret
|
|
32
31
|
},
|
|
33
32
|
props: {
|
|
34
33
|
variant: {
|
|
35
|
-
type: String
|
|
34
|
+
type: String as PropType<VariantsKey>,
|
|
36
35
|
required: false,
|
|
37
36
|
default: 'default',
|
|
38
37
|
validator: (prop: string): boolean => Object.keys(variants).includes(prop)
|
|
39
38
|
},
|
|
39
|
+
/** If populated, a router-link will be generated. Overrides `href` */
|
|
40
40
|
to: {
|
|
41
41
|
type: [String, Object],
|
|
42
42
|
default: undefined
|
|
43
43
|
},
|
|
44
|
+
/** Maps to the `exact` prop in Nuxt's native `NuxtLink` component. If `true`, `active-class` will be applied to the link only if the current path is an exact match. Only affects router links. */
|
|
44
45
|
exact: {
|
|
45
46
|
type: Boolean,
|
|
46
47
|
default: false
|
|
@@ -57,65 +58,73 @@ export default defineComponent({
|
|
|
57
58
|
type: String,
|
|
58
59
|
default: ''
|
|
59
60
|
},
|
|
61
|
+
/** Apply classes directly to the `<a>` element */
|
|
60
62
|
linkClass: {
|
|
61
63
|
type: String,
|
|
62
64
|
default: ''
|
|
63
65
|
},
|
|
64
|
-
|
|
66
|
+
/** This setting will always override the target, regardless of external link settings */
|
|
65
67
|
target: {
|
|
66
68
|
type: String,
|
|
67
69
|
required: false,
|
|
68
70
|
default: undefined
|
|
69
71
|
},
|
|
70
|
-
|
|
72
|
+
/** Autmatically sets target to `_blank` for external (non-router) links */
|
|
71
73
|
externalTargetBlank: {
|
|
72
74
|
type: Boolean,
|
|
73
75
|
required: false,
|
|
74
76
|
default: false
|
|
75
77
|
},
|
|
76
|
-
|
|
78
|
+
/** 'If a caret icon should be appended to the link. Set automatically when using the `primary` link variant. */
|
|
77
79
|
caret: {
|
|
78
80
|
type: Boolean,
|
|
79
81
|
required: false,
|
|
80
82
|
default: false
|
|
81
83
|
},
|
|
82
|
-
|
|
84
|
+
/** Add classes to the caret wrapper */
|
|
83
85
|
caretWrapperClass: {
|
|
84
86
|
type: String,
|
|
85
87
|
default: ''
|
|
86
88
|
},
|
|
87
|
-
|
|
89
|
+
/** Add classes directly to the caret. Maps to `MixinAnimationCaret`'s `arrowClass` prop. */
|
|
88
90
|
caretClass: {
|
|
89
91
|
type: String,
|
|
90
92
|
default: ''
|
|
91
93
|
},
|
|
92
|
-
|
|
94
|
+
/** Apply `inline` class to the caret wrapper */
|
|
93
95
|
caretInline: {
|
|
94
96
|
type: Boolean,
|
|
95
97
|
required: false,
|
|
96
98
|
default: false
|
|
97
99
|
},
|
|
98
|
-
|
|
100
|
+
/** Tailwind CSS text color class for the caret. Ex: `text-primary` */
|
|
99
101
|
caretColor: {
|
|
100
102
|
type: String,
|
|
101
103
|
required: false,
|
|
102
104
|
default: ''
|
|
103
105
|
},
|
|
106
|
+
/** Customize the left margin of the caret using Tailwind classes */
|
|
104
107
|
caretMarginLeft: {
|
|
105
108
|
type: String,
|
|
106
109
|
required: false,
|
|
107
110
|
default: ''
|
|
108
111
|
},
|
|
112
|
+
/** Overrides the theme's `active` color and uses the `primary` color instead. */
|
|
109
113
|
usePrimaryColor: {
|
|
110
114
|
type: Boolean,
|
|
111
115
|
required: false,
|
|
112
116
|
default: false
|
|
113
117
|
}
|
|
114
118
|
},
|
|
115
|
-
emits: [
|
|
119
|
+
emits: [
|
|
120
|
+
/** Apply classes directly to the `<a>` element. */
|
|
121
|
+
'linkClicked',
|
|
122
|
+
/** Locally emitted click event (includes event attributes) */
|
|
123
|
+
'specificLinkClicked'
|
|
124
|
+
],
|
|
116
125
|
computed: {
|
|
117
126
|
...mapStores(useThemeStore),
|
|
118
|
-
computedVariants()
|
|
127
|
+
computedVariants() {
|
|
119
128
|
if (this.usePrimaryColor) {
|
|
120
129
|
return primaryColorVariants
|
|
121
130
|
}
|
|
@@ -131,12 +140,14 @@ export default defineComponent({
|
|
|
131
140
|
}
|
|
132
141
|
return classes
|
|
133
142
|
},
|
|
143
|
+
/** If the href link is an external link relative to the EDU site */
|
|
134
144
|
isEduExternal(): boolean | string {
|
|
135
145
|
if (this.href) {
|
|
136
146
|
return isEduExternalLink(this.href)
|
|
137
147
|
}
|
|
138
148
|
return ''
|
|
139
149
|
},
|
|
150
|
+
/** If the href is an external link (takes theme and `isEduExternal` into account) */
|
|
140
151
|
isExternal(): boolean {
|
|
141
152
|
if (this.href) {
|
|
142
153
|
if (this.themeStore.isEdu && isEduExternalLink(this.href)) {
|
|
@@ -5,9 +5,6 @@ import BaseModalDialog from './BaseModalDialog.vue'
|
|
|
5
5
|
export default {
|
|
6
6
|
title: 'Components/Base/BaseModal',
|
|
7
7
|
component: BaseModal,
|
|
8
|
-
argTypes: {
|
|
9
|
-
bgClose: { control: { type: 'boolean' } }
|
|
10
|
-
},
|
|
11
8
|
excludeStories: /.*Data$/
|
|
12
9
|
}
|
|
13
10
|
|
|
@@ -15,7 +12,7 @@ export default {
|
|
|
15
12
|
const BaseModalTemplate = (args) => ({
|
|
16
13
|
props: Object.keys(args),
|
|
17
14
|
components: { BaseModal },
|
|
18
|
-
template: `<BaseModal :bg-close="bgClose"><div>Modal content. Lorem ipsum dolor sit amet.</div></BaseModal>`
|
|
15
|
+
template: `<BaseModal :bg-close="bgClose"><div>{{ bgClose }} Modal content. Lorem ipsum dolor sit amet.</div></BaseModal>`
|
|
19
16
|
})
|
|
20
17
|
const BaseModalWithTriggerTemplate = (args) => ({
|
|
21
18
|
props: Object.keys(args),
|
|
@@ -72,13 +69,13 @@ export const BaseModalDialogData = {
|
|
|
72
69
|
|
|
73
70
|
// stories
|
|
74
71
|
export const BaseStory = BaseModalTemplate.bind({})
|
|
75
|
-
BaseStory.args =
|
|
72
|
+
BaseStory.args = BaseModalData
|
|
76
73
|
|
|
77
74
|
export const CustomTrigger = BaseModalWithTriggerTemplate.bind({})
|
|
78
|
-
CustomTrigger.args =
|
|
75
|
+
CustomTrigger.args = BaseModalData
|
|
79
76
|
|
|
80
77
|
export const Nested = BaseModalNested.bind({})
|
|
81
|
-
Nested.args =
|
|
78
|
+
Nested.args = BaseModalData
|
|
82
79
|
|
|
83
80
|
export const Dialog = BaseModalDialogTemplate.bind({})
|
|
84
81
|
Dialog.args = { ...BaseModalDialogData, modalHeaderSlot: '' }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
class="bg-gray-dark fixed top-0 left-0 z-50 flex w-full h-full overflow-auto bg-opacity-75"
|
|
4
|
-
@click="
|
|
4
|
+
@click="bgClose ? closeModal() : null"
|
|
5
5
|
>
|
|
6
6
|
<div
|
|
7
7
|
class="relative w-full p-8 m-auto bg-white"
|
|
@@ -54,11 +54,6 @@ export default defineComponent({
|
|
|
54
54
|
methods: {
|
|
55
55
|
closeModal() {
|
|
56
56
|
this.$emit('close')
|
|
57
|
-
},
|
|
58
|
-
bgCloseModal() {
|
|
59
|
-
if (this.bgClose) {
|
|
60
|
-
this.closeModal()
|
|
61
|
-
}
|
|
62
57
|
}
|
|
63
58
|
}
|
|
64
59
|
})
|
|
@@ -1,27 +1,8 @@
|
|
|
1
1
|
import BasePill from './BasePill.vue'
|
|
2
|
-
import { eduMetadataDictionary } from './../../constants'
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
4
|
title: 'Components/Base/BasePill',
|
|
6
|
-
component: BasePill
|
|
7
|
-
argTypes: {
|
|
8
|
-
variant: {
|
|
9
|
-
type: { name: 'string', required: false },
|
|
10
|
-
description: 'The variant (color) of the tag',
|
|
11
|
-
control: { type: 'select' },
|
|
12
|
-
options: ['primary', 'secondary', 'action']
|
|
13
|
-
},
|
|
14
|
-
size: {
|
|
15
|
-
type: { name: 'string', required: false },
|
|
16
|
-
description: 'The size of the tag',
|
|
17
|
-
control: { type: 'select' },
|
|
18
|
-
options: ['sm', 'md', 'lg']
|
|
19
|
-
},
|
|
20
|
-
contentType: {
|
|
21
|
-
control: { type: 'select' },
|
|
22
|
-
options: Object.keys(eduMetadataDictionary)
|
|
23
|
-
}
|
|
24
|
-
}
|
|
5
|
+
component: BasePill
|
|
25
6
|
}
|
|
26
7
|
|
|
27
8
|
// stories
|
|
@@ -30,7 +11,7 @@ export const PrimaryMedium = {
|
|
|
30
11
|
size: 'md',
|
|
31
12
|
variant: 'primary',
|
|
32
13
|
text: 'Psyche Asteroid',
|
|
33
|
-
contentType:
|
|
14
|
+
contentType: undefined
|
|
34
15
|
}
|
|
35
16
|
}
|
|
36
17
|
|
|
@@ -39,5 +20,10 @@ export const SecondarySmall = {
|
|
|
39
20
|
}
|
|
40
21
|
|
|
41
22
|
export const WithType = {
|
|
42
|
-
args: {
|
|
23
|
+
args: {
|
|
24
|
+
size: 'sm',
|
|
25
|
+
variant: 'primary',
|
|
26
|
+
text: 'Student Project',
|
|
27
|
+
contentType: 'EDUStudentProjectPage'
|
|
28
|
+
}
|
|
43
29
|
}
|