@explorer-1/vue 0.3.6 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +1 -1
  3. package/src/components/AboutTheAuthor/AboutTheAuthor.stories.js +1 -1
  4. package/src/components/AboutTheAuthor/AboutTheAuthor.vue +9 -9
  5. package/src/components/AsteroidWatchWidget/AsteroidWatchWidget.stories.js +0 -5
  6. package/src/components/AsteroidWatchWidget/AsteroidWatchWidget.vue +5 -1
  7. package/src/components/BackToTop/BackToTop.stories.js +1 -1
  8. package/src/components/BackToTop/BackToTop.vue +10 -0
  9. package/src/components/BaseAccordionItem/BaseAccordionItem.stories.js +5 -29
  10. package/src/components/BaseAccordionItem/BaseAccordionItem.vue +56 -17
  11. package/src/components/BaseAudio/BaseAudio.vue +6 -0
  12. package/src/components/BaseButton/BaseButton.stories.ts +1 -20
  13. package/src/components/BaseButton/BaseButton.vue +34 -10
  14. package/src/components/BaseCheckboxGroup/BaseCheckboxGroup.stories.js +2 -1
  15. package/src/components/BaseCheckboxGroup/BaseCheckboxGroup.vue +5 -0
  16. package/src/components/BaseHeading/BaseHeading.stories.js +0 -15
  17. package/src/components/BaseHeading/BaseHeading.vue +18 -8
  18. package/src/components/BaseImage/BaseImage.stories.ts +6 -21
  19. package/src/components/BaseImage/BaseImage.vue +26 -14
  20. package/src/components/BaseImageCaption/BaseImageCaption.vue +10 -6
  21. package/src/components/BaseImagePlaceholder/BaseImagePlaceholder.stories.js +3 -16
  22. package/src/components/BaseImagePlaceholder/BaseImagePlaceholder.vue +13 -9
  23. package/src/components/BaseLink/BaseLink.stories.js +4 -46
  24. package/src/components/BaseLink/BaseLink.vue +32 -21
  25. package/src/components/BaseModal/BaseModal.stories.js +4 -7
  26. package/src/components/BaseModal/BaseModal.vue +1 -0
  27. package/src/components/BaseModal/BaseModalDialog.vue +1 -6
  28. package/src/components/BasePill/BasePill.stories.js +2 -22
  29. package/src/components/BasePill/BasePill.vue +36 -17
  30. package/src/components/BasePlaceholder/BasePlaceholder.stories.js +4 -7
  31. package/src/components/BasePlaceholder/BasePlaceholder.vue +1 -1
  32. package/src/components/BaseRadioGroup/BaseRadioGroup.stories.js +1 -0
  33. package/src/components/BaseRadioGroup/BaseRadioGroup.vue +9 -2
  34. package/src/components/BaseSwimlane/BaseSwimlane.stories.js +2 -1
  35. package/src/components/BaseSwimlane/BaseSwimlane.vue +2 -0
  36. package/src/components/BaseTimer/BaseTimer.stories.js +6 -1
  37. package/src/components/BaseTimer/BaseTimer.vue +4 -2
  38. package/src/components/BaseUnitToggle/BaseUnitToggle.stories.js +1 -16
  39. package/src/components/BaseUnitToggle/BaseUnitToggle.vue +4 -0
  40. package/src/components/BaseVideo/BaseVideo.vue +7 -3
  41. package/src/components/BlockAccordion/BlockAccordion.stories.js +1 -1
  42. package/src/components/BlockAccordion/BlockAccordion.vue +3 -3
  43. package/src/components/BlockAudio/BlockAudio.stories.js +1 -0
  44. package/src/components/BlockAudio/BlockAudio.vue +11 -3
  45. package/src/components/BlockCardGrid/BlockCardGrid.stories.js +1 -1
  46. package/src/components/BlockCardGrid/BlockCardGrid.vue +1 -1
  47. package/src/components/BlockCardGridItem/BlockCardGridItem.stories.js +1 -1
  48. package/src/components/BlockCircleImageCard/BlockCircleImageCard.stories.js +1 -8
  49. package/src/components/BlockCsrTable/BlockCsrTable.stories.js +1 -0
  50. package/src/components/BlockCsrTable/BlockCsrTable.vue +1 -1
  51. package/src/components/BlockCta/BlockCta.stories.js +1 -0
  52. package/src/components/BlockCta/BlockCta.vue +9 -2
  53. package/src/components/BlockDialog/BlockDialog.stories.js +2 -1
  54. package/src/components/BlockGist/BlockGist.stories.js +3 -2
  55. package/src/components/BlockGist/BlockGist.vue +8 -6
  56. package/src/components/BlockHeading/BlockHeading.stories.js +1 -0
  57. package/src/components/BlockIframeEmbed/BlockIframeEmbed.stories.js +1 -0
  58. package/src/components/BlockIframeEmbed/BlockIframeEmbed.vue +9 -2
  59. package/src/components/BlockImage/BlockImage.stories.js +1 -5
  60. package/src/components/BlockImage/BlockImage.vue +5 -2
  61. package/src/components/BlockImageCarousel/BlockImageCarousel.stories.js +1 -13
  62. package/src/components/BlockImageCarousel/BlockImageCarousel.vue +2 -0
  63. package/src/components/BlockImageCarouselItem/BlockImageCarouselItem.stories.js +0 -14
  64. package/src/components/BlockImageCarouselItem/BlockImageCarouselItem.vue +7 -7
  65. package/src/components/BlockImageComparison/BlockImageComparison.stories.js +3 -1
  66. package/src/components/BlockImageComparison/BlockImageComparison.vue +11 -2
  67. package/src/components/BlockImageGallery/BlockImageGallery.stories.js +2 -9
  68. package/src/components/BlockImageGallery/BlockImageGallery.vue +5 -0
  69. package/src/components/BlockInlineImage/BlockInlineImage.stories.js +1 -8
  70. package/src/components/BlockInlineImage/BlockInlineImage.vue +20 -7
  71. package/src/components/BlockKeyPoints/BlockKeyPoints.stories.js +1 -0
  72. package/src/components/BlockKeyPoints/BlockKeyPoints.vue +12 -3
  73. package/src/components/BlockLinkCard/BlockLinkCard.stories.js +5 -18
  74. package/src/components/BlockLinkCard/BlockLinkCard.vue +27 -8
  75. package/src/components/BlockLinkCard/BlockLinkCardCollectionLg.vue +2 -2
  76. package/src/components/BlockLinkCardList/BlockLinkCardList.stories.js +1 -3
  77. package/src/components/BlockLinkCarousel/BlockLinkCarousel.stories.js +2 -14
  78. package/src/components/BlockLinkCarousel/BlockLinkCarousel.vue +8 -8
  79. package/src/components/BlockLinkTile/BlockLinkTile.stories.js +1 -11
  80. package/src/components/BlockLinkTile/BlockLinkTile.vue +26 -13
  81. package/src/components/BlockListCards/BlockListCards.stories.js +1 -0
  82. package/src/components/BlockListCards/BlockListCards.vue +5 -4
  83. package/src/components/BlockNewsletterSignup/BlockNewsletterSignup.stories.js +1 -0
  84. package/src/components/BlockNewsletterSignup/BlockNewsletterSignup.vue +3 -2
  85. package/src/components/BlockQuote/BlockQuote.stories.js +1 -0
  86. package/src/components/BlockQuote/BlockQuote.vue +3 -2
  87. package/src/components/BlockRelatedLinks/BlockRelatedLinks.stories.js +1 -0
  88. package/src/components/BlockRelatedLinks/BlockRelatedLinks.vue +6 -4
  89. package/src/components/BlockRichTable/BlockRichTable.stories.js +1 -1
  90. package/src/components/BlockRichTable/BlockRichTable.vue +23 -9
  91. package/src/components/BlockStreamfield/BlockStreamfield.stories.js +1 -11
  92. package/src/components/BlockStreamfield/BlockStreamfield.vue +34 -31
  93. package/src/components/BlockTeaser/BlockTeaser.stories.js +1 -0
  94. package/src/components/BlockTeaser/BlockTeaser.vue +20 -12
  95. package/src/components/BlockText/BlockText.stories.js +2 -9
  96. package/src/components/BlockText/BlockText.vue +21 -9
  97. package/src/components/BlockVideo/BlockVideo.stories.js +1 -0
  98. package/src/components/BlockVideo/BlockVideo.vue +14 -3
  99. package/src/components/BlockVideoEmbed/BlockVideoEmbed.stories.js +1 -0
  100. package/src/components/BlockVideoEmbed/BlockVideoEmbed.vue +6 -3
  101. package/src/components/CalendarButton/CalendarButton.vue +7 -0
  102. package/src/components/DetailHeadline/DetailHeadline.stories.js +2 -20
  103. package/src/components/DetailHeadline/DetailHeadline.vue +16 -4
  104. package/src/components/DsnWidget/DsnWidget.stories.js +2 -6
  105. package/src/components/DsnWidget/DsnWidget.vue +18 -4
  106. package/src/components/EventDetailHero/EventDetailHero.vue +4 -7
  107. package/src/components/FormContact/FormContact.stories.js +2 -1
  108. package/src/components/FormNewsletterSignup/FormNewsletterSignup.stories.js +2 -1
  109. package/src/components/HeroInlineMedia/HeroInlineMedia.vue +12 -8
  110. package/src/components/HeroLarge/HeroLarge.stories.js +1 -0
  111. package/src/components/HeroLarge/HeroLarge.vue +12 -7
  112. package/src/components/HeroListingIndex/HeroListingIndex.stories.js +1 -0
  113. package/src/components/HeroListingIndex/HeroListingIndex.vue +18 -13
  114. package/src/components/HeroMedia/HeroMedia.stories.js +13 -8
  115. package/src/components/HeroMedia/HeroMedia.vue +9 -8
  116. package/src/components/HeroMedium/HeroMedium.stories.js +1 -0
  117. package/src/components/HeroMedium/HeroMedium.vue +32 -14
  118. package/src/components/HeroMedium/HeroSmall.stories.js +2 -2
  119. package/src/components/HomepageCarousel/HomepageCarousel.stories.js +1 -1
  120. package/src/components/HomepageCarouselItem/HomepageCarouselItem.vue +2 -6
  121. package/src/components/HomepageEmbedBlock/HomepageEmbedBlock.vue +2 -2
  122. package/src/components/LogoCaltech/LogoCaltech.stories.js +14 -18
  123. package/src/components/LogoCaltech/LogoCaltech.vue +1 -0
  124. package/src/components/LogoTribrand/LogoTribrand.stories.js +66 -51
  125. package/src/components/LogoTribrand/LogoTribrand.vue +4 -2
  126. package/src/components/MetaPanel/MetaPanel.stories.js +4 -8
  127. package/src/components/MetaPanel/MetaPanel.vue +3 -0
  128. package/src/components/MetaPanelItems/MetaPanelItems.stories.js +9 -2
  129. package/src/components/MetaPanelItems/MetaPanelItems.vue +2 -0
  130. package/src/components/MetadataEduResource/MetadataEduResource.stories.js +12 -10
  131. package/src/components/MetadataEduResource/MetadataEduResource.vue +7 -3
  132. package/src/components/MetadataEvent/MetadataEvent.stories.js +1 -1
  133. package/src/components/MissionDetailAbout/MissionDetailAbout.vue +1 -1
  134. package/src/components/MissionDetailHighlights/MissionDetailHighlights.stories.js +1 -0
  135. package/src/components/MissionDetailInlineImage/MissionDetailInlineImage.stories.js +1 -6
  136. package/src/components/MissionDetailInlineImage/MissionDetailInlineImage.vue +10 -5
  137. package/src/components/MissionDetailStats/DistanceStats.vue +10 -5
  138. package/src/components/MissionDetailStats/MissionDetailStats.stories.js +2 -19
  139. package/src/components/MissionDetailStats/MissionDetailStats.vue +21 -5
  140. package/src/components/MissionDetailStreamfield/MissionDetailStreamfield.vue +4 -2
  141. package/src/components/MixinAnimationCaret/MixinAnimationCaret.stories.ts +7 -0
  142. package/src/components/MixinAnimationCaret/MixinAnimationCaret.vue +12 -6
  143. package/src/components/MixinCarousel/MixinCarousel.stories.js +2 -8
  144. package/src/components/MixinCarousel/MixinCarousel.vue +13 -16
  145. package/src/components/MixinVideoBg/MixinVideoBg.stories.js +1 -1
  146. package/src/components/MixinVideoBg/MixinVideoBg.vue +4 -7
  147. package/src/components/NavDesktop/NavDesktop.stories.js +1 -0
  148. package/src/components/NavDesktop/NavDesktop.vue +4 -4
  149. package/src/components/NavDesktop/NavDesktopTopHat.vue +4 -4
  150. package/src/components/NavDesktopEdu/NavDesktopEdu.stories.js +1 -5
  151. package/src/components/NavDesktopEdu/NavDesktopEdu.vue +4 -4
  152. package/src/components/NavHeading/NavHeading.stories.js +1 -0
  153. package/src/components/NavHighlight/NavHighlight.stories.js +1 -0
  154. package/src/components/NavJumpMenu/NavJumpMenu.stories.js +5 -2
  155. package/src/components/NavLinkList/NavLinkList.stories.js +1 -0
  156. package/src/components/NavLinkList/NavLinkList.vue +3 -3
  157. package/src/components/NavLogoLinks/NavLogoLinks.stories.js +1 -0
  158. package/src/components/NavMobile/NavMobile.stories.js +9 -3
  159. package/src/components/NavMobile/NavMobile.vue +18 -5
  160. package/src/components/NavMobile/NavMobileDropdown.vue +2 -2
  161. package/src/components/NavMobile/NavMobileEdu.stories.js +3 -2
  162. package/src/components/NavMobile/NavMobileLink.vue +4 -4
  163. package/src/components/NavSearchForm/NavSearchForm.stories.js +1 -0
  164. package/src/components/NavSecondary/NavSecondary.stories.js +1 -0
  165. package/src/components/NavSecondary/NavSecondary.vue +7 -4
  166. package/src/components/NavSecondary/NavSecondaryDropdownContent.vue +1 -1
  167. package/src/components/NavSocial/NavSocial.stories.js +1 -0
  168. package/src/components/NewsDetailMediaContact/NewsDetailMediaContact.stories.js +2 -1
  169. package/src/components/NewsDetailMediaContact/NewsDetailMediaContact.vue +1 -1
  170. package/src/components/ParallaxContainer/ParallaxContainer.vue +1 -0
  171. package/src/components/PodcastSeriesCarousel/PodcastSeriesCarousel.vue +6 -5
  172. package/src/components/RoboticsDetailStats/RoboticsDetailStats.stories.js +1 -6
  173. package/src/components/SearchFilterGroup/SearchFilterGroup.stories.js +1 -0
  174. package/src/components/SearchInput/SearchInput.stories.js +1 -0
  175. package/src/components/SearchPagination/SearchPagination.stories.js +1 -0
  176. package/src/components/SearchResultCard/SearchResultCard.stories.js +1 -10
  177. package/src/components/SearchResultCard/SearchResultCard.vue +1 -0
  178. package/src/components/SearchResultGridItem/SearchResultGridItem.stories.js +1 -10
  179. package/src/components/SearchResultGridItem/SearchResultGridItem.vue +5 -2
  180. package/src/components/SearchResultsList/SearchResultsList.stories.js +1 -1
  181. package/src/components/SearchSelectMenu/SearchSelectMenu.stories.js +2 -1
  182. package/src/components/SwimlaneCTA/SwimlaneCTA.vue +1 -0
  183. package/src/components/TextArea/TextArea.stories.js +2 -1
  184. package/src/components/TextInput/TextInput.stories.js +2 -1
  185. package/src/components/TheFooter/TheFooter.stories.js +1 -0
  186. package/src/components/TheFooter/TheFooter.vue +30 -4
  187. package/src/components/ThumbnailCarousel/ThumbnailCarousel.stories.js +1 -1
  188. package/src/components/ThumbnailCarousel/ThumbnailCarousel.vue +2 -1
  189. package/src/components/TimelineDialog/TimelineDialog.vue +2 -2
  190. package/src/components/TopicDetailMissionCarousel/TopicDetailMissionCarousel.stories.js +1 -0
  191. package/src/components/TopicDetailMore/TopicDetailMore.stories.js +1 -0
  192. package/src/components/TopicDetailMoreItem/TopicDetailMoreItem.stories.js +1 -0
  193. package/src/components/TopicDetailStreamfield/TopicDetailStreamfield.vue +2 -2
  194. package/src/constants.ts +3 -5
  195. package/src/interfaces.ts +31 -6
  196. package/src/templates/PageAudioDetail/PageAudioDetail.vue +2 -2
  197. package/src/templates/edu/PageEduGalleryDetail/PageEduGalleryDetail.vue +10 -6
  198. package/src/templates/edu/PageEduStudentProject/PageEduStudentProjectSection.vue +10 -6
  199. package/src/templates/www/PageTopicDetail/PageTopicDetail.vue +2 -1
  200. package/src/utils/mixins.ts +7 -7
@@ -124,7 +124,8 @@ import BaseLink from './../BaseLink/BaseLink.vue'
124
124
  import BaseHeading from './../BaseHeading/BaseHeading.vue'
125
125
  import BasePill from '../BasePill/BasePill.vue'
126
126
 
127
- export const pillColorVariants = ['primary', 'secondary', 'action']
127
+ export const pillColorVariants = ['primary', 'secondary', 'action', 'primary-inverted'] as const
128
+ export type PillColorVariant = (typeof pillColorVariants)[number]
128
129
 
129
130
  export default defineComponent({
130
131
  name: 'DetailHeadline',
@@ -134,60 +135,71 @@ export default defineComponent({
134
135
  BasePill
135
136
  },
136
137
  props: {
138
+ /** Title of detail page */
137
139
  title: {
138
140
  type: String,
139
141
  required: false,
140
142
  default: undefined
141
143
  },
144
+ /** Author or array of authors */
142
145
  author: {
143
146
  type: Object as PropType<AuthorObject | { author: AuthorObject }[]>,
144
147
  required: false,
145
148
  default: undefined
146
149
  },
150
+ /** Publication date */
147
151
  publicationDate: {
148
152
  type: String,
149
153
  required: false,
150
154
  default: undefined
151
155
  },
156
+ /** Publication time */
152
157
  publicationTime: {
153
158
  type: String,
154
159
  required: false,
155
160
  default: undefined
156
161
  },
162
+ /** Approximate read time */
157
163
  readTime: {
158
164
  type: String,
159
165
  required: false,
160
166
  default: undefined
161
167
  },
168
+ /** Array of related topics */
162
169
  topics: {
163
170
  type: Array as PropType<Topic[]>,
164
171
  required: false,
165
172
  default: undefined
166
173
  },
167
- // if topics array isn't available
174
+ /** Label, if there are no related topics */
168
175
  label: {
169
176
  type: String,
170
177
  required: false,
171
178
  default: undefined
172
179
  },
180
+ /** Option link for the label */
173
181
  labelLink: {
174
182
  type: String,
175
183
  required: false,
176
184
  default: undefined
177
185
  },
186
+ /** If the label should use the "pill" style (only works when using ThemeEdu) */
178
187
  pill: {
179
188
  type: Boolean,
180
189
  default: false
181
190
  },
191
+ /** Pill color variants */
182
192
  pillColor: {
183
- type: String,
193
+ type: String as PropType<PillColorVariant>,
184
194
  default: 'primary',
185
- validator: (prop: string): boolean => pillColorVariants.includes(prop)
195
+ validator: (prop: PillColorVariant): boolean => pillColorVariants.includes(prop)
186
196
  },
197
+ /** If schema.org metadata should be generated */
187
198
  schema: {
188
199
  type: Boolean,
189
200
  default: false
190
201
  },
202
+ /** If publication date should be hidden */
191
203
  hideDate: {
192
204
  type: Boolean,
193
205
  default: false
@@ -3,12 +3,8 @@ import DsnWidget from './DsnWidget.vue'
3
3
  export default {
4
4
  title: 'Components/WWW/DsnWidget',
5
5
  component: DsnWidget,
6
- excludeStories: /.*Data$/,
7
- argTypes: {
8
- status: {
9
- control: { type: 'text' }
10
- }
11
- }
6
+ tags: ['widget'],
7
+ excludeStories: /.*Data$/
12
8
  }
13
9
 
14
10
  export const DsnWidgetData = {
@@ -74,12 +74,24 @@
74
74
  </div>
75
75
  </template>
76
76
  <script lang="ts">
77
- import { defineComponent } from 'vue'
77
+ import { defineComponent, type PropType } from 'vue'
78
78
  import BaseLink from './../BaseLink/BaseLink.vue'
79
79
  import IconArrows from './../Icons/IconArrows.vue'
80
80
  /**
81
- * Displays dsn widget data. API is parsed by the backend. Frontend retrieves via a graphQL query.
81
+ * Displays dsn widget data. API is parsed by the backend and passed to the frontend via GraphQL.
82
82
  */
83
+
84
+ type DsnWidgetObject = {
85
+ heading: string
86
+ link: string
87
+ linkTarget: string
88
+ transmitTitle: string
89
+ transmitStatus: string
90
+ spacecraftName: string
91
+ location: string
92
+ __typename: string
93
+ }
94
+
83
95
  export default defineComponent({
84
96
  name: 'DsnWidget',
85
97
  components: {
@@ -87,9 +99,11 @@ export default defineComponent({
87
99
  IconArrows
88
100
  },
89
101
  props: {
102
+ /** Backend retrieves data and passes it to the frontend as a DsnWidgetObject */
90
103
  data: {
91
- type: Object,
92
- required: false
104
+ type: Object as PropType<DsnWidgetObject>,
105
+ required: false,
106
+ default: undefined
93
107
  }
94
108
  }
95
109
  })
@@ -30,7 +30,8 @@
30
30
  </div>
31
31
  </template>
32
32
  <script lang="ts">
33
- import { defineComponent } from 'vue'
33
+ import { defineComponent, type PropType } from 'vue'
34
+ import type { ImageObject } from './../../interfaces.ts'
34
35
  import BaseImage from '../BaseImage/BaseImage.vue'
35
36
  import BaseImagePlaceholder from '../BaseImagePlaceholder/BaseImagePlaceholder.vue'
36
37
  import CalendarChip from '../CalendarChip/CalendarChip.vue'
@@ -44,11 +45,6 @@ export default defineComponent({
44
45
  CalendarChip
45
46
  },
46
47
  props: {
47
- data: {
48
- type: Object,
49
- required: false,
50
- default: undefined
51
- },
52
48
  startDate: {
53
49
  type: String,
54
50
  required: false,
@@ -63,10 +59,11 @@ export default defineComponent({
63
59
  default: false
64
60
  },
65
61
  image: {
66
- type: Object,
62
+ type: Object as PropType<ImageObject>,
67
63
  required: false,
68
64
  default: undefined
69
65
  },
66
+ /** Constrain image to 16:9 */
70
67
  constrain: {
71
68
  type: Boolean,
72
69
  required: false,
@@ -2,7 +2,8 @@ import FormContact from './FormContact.vue'
2
2
 
3
3
  export default {
4
4
  title: 'Components/Forms/FormContact',
5
- component: FormContact
5
+ component: FormContact,
6
+ tags: ['forms']
6
7
  }
7
8
 
8
9
  // template
@@ -2,7 +2,8 @@ import FormNewsletterSignup from './FormNewsletterSignup.vue'
2
2
 
3
3
  export default {
4
4
  title: 'Components/Forms/FormNewsletterSignup',
5
- component: FormNewsletterSignup
5
+ component: FormNewsletterSignup,
6
+ tags: ['forms']
6
7
  }
7
8
 
8
9
  // template
@@ -1,11 +1,15 @@
1
1
  <script setup lang="ts">
2
2
  import { reactive } from 'vue'
3
- import BlockVideoEmbed from './../BlockVideoEmbed/BlockVideoEmbed.vue'
4
- import BlockIframeEmbed from './../BlockIframeEmbed/BlockIframeEmbed.vue'
5
- import BlockImageComparison from './../BlockImageComparison/BlockImageComparison.vue'
3
+ import BlockVideoEmbed, { type BlockVideoEmbedData } from './../BlockVideoEmbed/BlockVideoEmbed.vue'
4
+ import BlockIframeEmbed, {
5
+ type BlockIframeEmbedData
6
+ } from './../BlockIframeEmbed/BlockIframeEmbed.vue'
7
+ import BlockImageComparison, {
8
+ type BlockImageComparisonData
9
+ } from './../BlockImageComparison/BlockImageComparison.vue'
6
10
  import BlockImageCarousel from './../BlockImageCarousel/BlockImageCarousel.vue'
7
11
  import BlockImageStandard from './../BlockImage/BlockImageStandard.vue'
8
- import BlockVideo from './../BlockVideo/BlockVideo.vue'
12
+ import BlockVideo, { type BlockVideoData } from './../BlockVideo/BlockVideo.vue'
9
13
  import type { StreamfieldBlockData } from './../../interfaces'
10
14
 
11
15
  interface HeroInlineMediaProps {
@@ -36,19 +40,19 @@ const { heroBlocks, constrain } = reactive(props)
36
40
  />
37
41
  <BlockIframeEmbed
38
42
  v-else-if="heroBlocks[0].blockType === 'IframeEmbedBlock'"
39
- :data="heroBlocks[0]"
43
+ :data="heroBlocks[0] as BlockIframeEmbedData"
40
44
  />
41
45
  <BlockVideo
42
46
  v-else-if="heroBlocks[0].blockType === 'VideoBlock'"
43
- :data="heroBlocks[0]"
47
+ :data="heroBlocks[0] as BlockVideoData"
44
48
  />
45
49
  <BlockVideoEmbed
46
50
  v-else-if="heroBlocks[0].blockType === 'VideoEmbedBlock'"
47
- :data="heroBlocks[0]"
51
+ :data="heroBlocks[0] as BlockVideoEmbedData"
48
52
  />
49
53
  <BlockImageComparison
50
54
  v-else-if="heroBlocks[0].blockType === 'ImageComparisonBlock'"
51
- :data="heroBlocks[0]"
55
+ :data="heroBlocks[0] as BlockImageComparisonData"
52
56
  />
53
57
  </div>
54
58
  </template>
@@ -4,6 +4,7 @@ import { eduMetadataDictionary } from './../../constants'
4
4
  export default {
5
5
  title: 'Components/Heroes/Large',
6
6
  component: HeroLarge,
7
+ tags: ['heroes'],
7
8
  excludeStories: /.*Data$/,
8
9
  parameters: {
9
10
  viewMode: 'canvas'
@@ -7,10 +7,14 @@
7
7
  :srcset="theSrcSet"
8
8
  />
9
9
  <source
10
+ v-if="image.screenMd"
10
11
  media="(min-width: 420px)"
11
12
  :srcset="image.screenMd.url"
12
13
  />
13
- <source :srcset="image.screenSm.url" />
14
+ <source
15
+ v-if="image.screenSm"
16
+ :srcset="image.screenSm.url"
17
+ />
14
18
  <img
15
19
  class="md:object-right object-cover object-bottom w-full h-full"
16
20
  :src="image.src.url"
@@ -71,8 +75,9 @@
71
75
  </div>
72
76
  </template>
73
77
  <script lang="ts">
74
- import { defineComponent } from 'vue'
78
+ import { defineComponent, type PropType } from 'vue'
75
79
  import { mixinTransparentHeader, mixinGetSrcSet } from './../../utils/mixins'
80
+ import type { ContentTypeKey, ImageObject } from './../../interfaces.ts'
76
81
  import { mapStores } from 'pinia'
77
82
  import { useThemeStore } from '../../store/theme'
78
83
  import BasePill from './../BasePill/BasePill.vue'
@@ -88,15 +93,15 @@ export default defineComponent({
88
93
  required: false,
89
94
  default: undefined
90
95
  },
91
- // custom text for pill
96
+ /** Text for pill (overrides label) */
92
97
  customPill: {
93
98
  type: String,
94
99
  required: false,
95
100
  default: undefined
96
101
  },
97
- // maps to EDU resource types
102
+ /** Maps to EDU resource types. Label is replaced with a color-themed "pill." Must use with `.ThemeEdu` */
98
103
  customPillType: {
99
- type: String,
104
+ type: String as PropType<ContentTypeKey>,
100
105
  required: false,
101
106
  default: undefined
102
107
  },
@@ -111,11 +116,11 @@ export default defineComponent({
111
116
  default: undefined
112
117
  },
113
118
  image: {
114
- type: Object,
119
+ type: Object as PropType<ImageObject>,
115
120
  required: false,
116
121
  default: undefined
117
122
  },
118
- // If secondary nav is also on this page, will add more space above hero text
123
+ /** If secondary nav is also on this page, more space will be added above the hero text */
119
124
  hasOverlay: {
120
125
  type: Boolean,
121
126
  default: false
@@ -3,6 +3,7 @@ import HeroListingIndex from './HeroListingIndex.vue'
3
3
  export default {
4
4
  title: 'Components/Heroes/For Listing Pages',
5
5
  component: HeroListingIndex,
6
+ tags: ['heroes'],
6
7
  parameters: {
7
8
  viewMode: 'canvas'
8
9
  },
@@ -20,13 +20,16 @@
20
20
  </div>
21
21
  </template>
22
22
  <script lang="ts">
23
- // HeroListingIndex
24
- // Creating a wrapper for HeroMedium as HeroListingIndex needs to parse several different data shapes.
25
- // Parsing occurs in the computed data and returns the appropriate data object for the media if it exists.
26
- import { defineComponent } from 'vue'
23
+ /**
24
+ * HeroListingIndex
25
+ * Creating a wrapper for HeroMedium as HeroListingIndex needs to parse several different data shapes.
26
+ * Parsing occurs in the computed data and returns the appropriate data object for the media if it exists.
27
+ */
28
+ import { defineComponent, type PropType } from 'vue'
29
+ import type { ImageObject, StreamfieldBlockData, VideoObject } from './../../interfaces'
27
30
  import { useThemeStore } from '../../store/theme'
28
31
  import { mapStores } from 'pinia'
29
- import HeroMedium from '../HeroMedium/HeroMedium.vue'
32
+ import HeroMedium, { type FeatureObject } from '../HeroMedium/HeroMedium.vue'
30
33
 
31
34
  export default defineComponent({
32
35
  name: 'HeroListingIndex',
@@ -36,7 +39,7 @@ export default defineComponent({
36
39
  props: {
37
40
  // pass these directly to HeroMedium
38
41
  pageData: {
39
- type: Object,
42
+ type: Object as PropType<FeatureObject>,
40
43
  default: undefined
41
44
  },
42
45
  customLabel: {
@@ -51,24 +54,26 @@ export default defineComponent({
51
54
  computed: {
52
55
  ...mapStores(useThemeStore),
53
56
  // parses a hero streamfield block for a video (newsDetailPage model)
54
- customVideo(): object | undefined {
55
- if (this.pageData && this.pageData?.heroBlocks?.length > 0) {
57
+ customVideo(): VideoObject | undefined {
58
+ if (this.pageData && this.pageData?.heroBlocks && this.pageData.heroBlocks.length > 0) {
56
59
  if (this.pageData.heroBlocks[0].blockType === 'VideoBlock') {
57
60
  return this.pageData.heroBlocks[0].video
58
61
  }
59
62
  }
60
63
  return undefined
61
64
  },
62
- customImage(): object | undefined {
65
+ customImage(): ImageObject | undefined {
63
66
  // parse hero streamfield block for the first usable image (newsDetailPage model)
64
- if (this.pageData?.heroBlocks?.length > 0) {
67
+ if (this.pageData && this.pageData.heroBlocks && this.pageData.heroBlocks.length > 0) {
65
68
  const block = this.pageData?.heroBlocks[0]
66
69
  if (block.blockType === 'ImageChooserBlock' || block.blockType === 'HeroImageBlock') {
67
- return block.listingPageHeroImage
70
+ return (block as StreamfieldBlockData).listingPageHeroImage
68
71
  } else if (block.blockType === 'CarouselBlock') {
69
72
  // use the first image in the carousel
70
- if (block.blocks && block.blocks.length > 0) {
71
- return block.blocks[0].listingPageHeroImage
73
+ const carouselBlocks: ImageObject[] | undefined = (block as StreamfieldBlockData)
74
+ .blocks as ImageObject[]
75
+ if (carouselBlocks && carouselBlocks?.length > 0) {
76
+ return carouselBlocks[0].listingPageHeroImage
72
77
  }
73
78
  }
74
79
  }
@@ -4,6 +4,7 @@ import HeroMedia from './HeroMedia.vue'
4
4
  export default {
5
5
  title: 'Components/Heroes/Media Only',
6
6
  component: HeroMedia,
7
+ tags: ['heroes'],
7
8
  parameters: {
8
9
  html: {
9
10
  root: '#storyRoot'
@@ -77,21 +78,25 @@ export const HeroMediaData = {
77
78
  displayCaption: true
78
79
  }
79
80
 
81
+ const LocalHeroMediaData = { ...HeroMediaData }
82
+ delete LocalHeroMediaData.imageInline
83
+ delete LocalHeroMediaData.blockType
84
+
80
85
  // stories
81
86
  export const BaseStory = {
82
87
  name: 'HeroMedia',
83
- args: HeroMediaData
88
+ args: LocalHeroMediaData
84
89
  }
85
90
  export const CustomImageCaption = {
86
91
  args: {
87
- ...HeroMediaData,
92
+ ...LocalHeroMediaData,
88
93
  caption: '<p>My custom caption.</p>'
89
94
  }
90
95
  }
91
96
 
92
97
  export const NoCaptionText = {
93
98
  args: {
94
- ...HeroMediaData,
99
+ ...LocalHeroMediaData,
95
100
  caption: '<p>My custom caption.</p>',
96
101
  displayCaption: false
97
102
  }
@@ -100,7 +105,7 @@ export const NoCaptionText = {
100
105
  export const NoCaptionArea = {
101
106
  args: {
102
107
  image: {
103
- src: HeroMediaData.image.src,
108
+ src: LocalHeroMediaData.image.src,
104
109
  alt: 'The hero image',
105
110
  caption: '\n', // a lot of prod data has this for caption
106
111
  credit: '',
@@ -113,10 +118,10 @@ export const NoCaptionArea = {
113
118
  export const NoLink = {
114
119
  args: {
115
120
  image: {
116
- src: HeroMediaData.image.src,
117
- alt: HeroMediaData.image.src,
118
- caption: HeroMediaData.image.caption,
119
- credit: HeroMediaData.image.credit,
121
+ src: LocalHeroMediaData.image.src,
122
+ alt: LocalHeroMediaData.image.src,
123
+ caption: LocalHeroMediaData.image.caption,
124
+ credit: LocalHeroMediaData.image.credit,
120
125
  detailUrl: ''
121
126
  },
122
127
  caption: '',
@@ -52,14 +52,16 @@
52
52
  </div>
53
53
  </template>
54
54
  <script lang="ts">
55
- import { defineComponent } from 'vue'
55
+ /** Hero with no text overlay, just an image or video with a caption below. */
56
+
57
+ import { defineComponent, type PropType } from 'vue'
56
58
  import { mapStores } from 'pinia'
57
59
  import { useThemeStore } from '../../store/theme'
58
60
  import MixinVideoBg from './../MixinVideoBg/MixinVideoBg.vue'
59
61
  import BaseImageCaption from './../BaseImageCaption/BaseImageCaption.vue'
60
62
  import IconInfo from './../Icons/IconInfo.vue'
61
63
  import IconClose from './../Icons/IconClose.vue'
62
- import type { ImageObject } from '../../interfaces'
64
+ import type { ImageObject, VideoObject } from '../../interfaces'
63
65
  import { mixinGetSrcSet, mixinTransparentHeader } from './../../utils/mixins'
64
66
 
65
67
  export default defineComponent({
@@ -77,21 +79,20 @@ export default defineComponent({
77
79
  IconClose
78
80
  },
79
81
  props: {
80
- // image object includes the image caption and credit
81
82
  image: {
82
- type: Object,
83
+ type: Object as () => ImageObject,
83
84
  default: undefined
84
85
  },
85
86
  video: {
86
- type: Object,
87
+ type: Object as PropType<VideoObject>,
87
88
  default: undefined
88
89
  },
89
- // if a caption should even be visible
90
+ /** If a caption should even be visible */
90
91
  displayCaption: {
91
92
  type: Boolean,
92
93
  default: true
93
94
  },
94
- // for video heroes that pass separate caption and credit data
95
+ /** For video heroes that pass separate caption and credit data, or to override the caption in `{ImageObject}` */
95
96
  caption: {
96
97
  type: String,
97
98
  default: undefined
@@ -152,7 +153,7 @@ export default defineComponent({
152
153
  return 'flex'
153
154
  }
154
155
  },
155
- hasCaptionArea(): string | boolean {
156
+ hasCaptionArea(): string | boolean | undefined {
156
157
  if (this.theImageData) {
157
158
  if (this.themeStore.isEdu) {
158
159
  // For EDU, only show the caption area if there is a caption
@@ -5,6 +5,7 @@ import { eduMetadataDictionary } from './../../constants'
5
5
  export default {
6
6
  title: 'Components/Heroes/Medium',
7
7
  component: HeroMedium,
8
+ tags: ['heroes'],
8
9
  decorators: [
9
10
  () => ({
10
11
  template: `<div id="storyRoot" class="max-w-screen-3xl mx-auto"><story/></div>`
@@ -96,18 +96,33 @@
96
96
  </section>
97
97
  </template>
98
98
  <script lang="ts">
99
- // HeroMedium
100
- // A hero image with article link overlay
101
- // For use when the hero includes a featured content item with link
102
- // note: This component is very similar to a HomepageCarousel slide
103
- import { defineComponent } from 'vue'
99
+ /**
100
+ * HeroMedium
101
+ * A hero image with article link overlay
102
+ * For use when the hero includes a featured content item with link
103
+ * note: This component is very similar to a HomepageCarousel slide
104
+ */
105
+ import { defineComponent, type PropType } from 'vue'
104
106
  import { mixinTransparentHeader } from '../../utils/mixins'
105
- import type { ImageObject } from '../../interfaces'
107
+ import type {
108
+ ContentTypeKey,
109
+ ImageObject,
110
+ VideoObject,
111
+ PageObject,
112
+ StreamfieldBlockData
113
+ } from '../../interfaces'
114
+ import type { BlockVideoData } from './../BlockVideo/BlockVideo.vue'
106
115
  import IconArrow from './../Icons/IconArrow.vue'
107
116
  import BaseLink from './../BaseLink/BaseLink.vue'
108
117
  import BasePill from './../BasePill/BasePill.vue'
109
118
  import MixinVideoBg from './../MixinVideoBg/MixinVideoBg.vue'
110
119
 
120
+ export type FeatureObject = PageObject & {
121
+ image?: ImageObject
122
+ video?: VideoObject
123
+ heroBlocks?: (BlockVideoData | StreamfieldBlockData)[]
124
+ listingPageHeroImage?: ImageObject
125
+ }
111
126
  export default defineComponent({
112
127
  name: 'HeroMedium',
113
128
  components: {
@@ -117,18 +132,21 @@ export default defineComponent({
117
132
  BasePill
118
133
  },
119
134
  props: {
135
+ /** Data for the hero. Usually derived from a page's data */
120
136
  feature: {
121
- type: Object,
137
+ type: Object as PropType<FeatureObject>,
122
138
  required: false,
123
139
  default: undefined
124
140
  },
141
+ /** Text for pill (overrides label) */
125
142
  customPill: {
126
143
  type: String,
127
144
  required: false,
128
145
  default: undefined
129
146
  },
147
+ /** Maps to EDU resource types. Label is replaced with a color-themed "pill." Must use with `.ThemeEdu` */
130
148
  customPillType: {
131
- type: String,
149
+ type: String as PropType<ContentTypeKey>,
132
150
  required: false,
133
151
  default: undefined
134
152
  },
@@ -146,21 +164,21 @@ export default defineComponent({
146
164
  required: false,
147
165
  default: false
148
166
  },
149
- // to override media
150
- // use-case: news detail pages use this b/c their feature hero is structured differently
167
+ /** Overrides feature video. Use-case: news detail pages use this b/c their feature hero is structured differently */
151
168
  customVideo: {
152
- type: Object,
169
+ type: Object as PropType<VideoObject>,
153
170
  required: false,
154
171
  default: undefined
155
172
  },
173
+ /** Overrides feature image. Use-case: news detail pages use this b/c their feature hero is structured differently */
156
174
  customImage: {
157
- type: Object,
175
+ type: Object as PropType<ImageObject>,
158
176
  required: false,
159
177
  default: undefined
160
178
  }
161
179
  },
162
180
  computed: {
163
- theVideo(): object | null {
181
+ theVideo(): VideoObject | null {
164
182
  if (this.customVideo) {
165
183
  return this.customVideo
166
184
  } else if (this.feature?.video?.file) {
@@ -168,7 +186,7 @@ export default defineComponent({
168
186
  }
169
187
  return null
170
188
  },
171
- theImage(): Partial<ImageObject> | null {
189
+ theImage(): ImageObject | null {
172
190
  if (this.customImage) {
173
191
  return this.customImage
174
192
  } else if (this.feature?.image?.src) {
@@ -6,6 +6,7 @@ import { eduMetadataDictionary } from './../../constants'
6
6
  export default {
7
7
  title: 'Components/Heroes/Small',
8
8
  component: HeroMedium,
9
+ tags: ['heroes'],
9
10
  decorators: [
10
11
  () => ({
11
12
  template: `<div id="storyRoot" class="max-w-screen-3xl mx-auto"><story/></div>`
@@ -41,8 +42,7 @@ export default {
41
42
  },
42
43
  docs: {
43
44
  description: {
44
- component:
45
- '`HeroSmall` is the same component as `HeroMedium, but with `compact` set to `true`.'
45
+ component: 'This is the same component as `HeroMedium, but with `compact` set to `true`.'
46
46
  }
47
47
  }
48
48
  },
@@ -4,7 +4,7 @@ import HomepageCarousel from './HomepageCarousel.vue'
4
4
  export default {
5
5
  title: 'Components/WWW/Homepage/HomepageCarousel',
6
6
  component: HomepageCarousel,
7
- tags: ['!autodocs'],
7
+ tags: ['carousels'],
8
8
  excludeStories: /.*Data$/,
9
9
  parameters: {
10
10
  viewMode: 'canvas'
@@ -98,7 +98,7 @@
98
98
  <script lang="ts">
99
99
  import { defineComponent, resolveComponent } from 'vue'
100
100
  import type { PropType } from 'vue'
101
- import type { ImageObject } from '../../interfaces'
101
+ import type { ImageObject, VideoObject } from '../../interfaces'
102
102
  import BaseLink from './../BaseLink/BaseLink.vue'
103
103
  import IconArrow from './../Icons/IconArrow.vue'
104
104
 
@@ -109,11 +109,7 @@ export interface Slide {
109
109
  url: string
110
110
  }
111
111
  heading: string
112
- video: {
113
- file: string
114
- fileOgg: string
115
- fileWebm: string
116
- }
112
+ video: Partial<VideoObject>
117
113
  listingPageHeroImage: Partial<ImageObject>
118
114
  }
119
115