@explorer-1/vue 0.3.6 → 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.
Files changed (200) hide show
  1. package/CHANGELOG.md +6 -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
@@ -27,17 +27,26 @@
27
27
  </template>
28
28
 
29
29
  <script lang="ts">
30
- import { defineComponent } from 'vue'
30
+ import { defineComponent, type PropType } from 'vue'
31
+ import type { BlockData, ImageObject } from './../../interfaces.ts'
31
32
  import BaseImageCaption from './../BaseImageCaption/BaseImageCaption.vue'
32
33
 
34
+ export type BlockImageComparisonData = BlockData & {
35
+ beforeImage: ImageObject
36
+ afterImage: ImageObject
37
+ constrain: boolean
38
+ caption: string
39
+ }
40
+
33
41
  export default defineComponent({
34
42
  name: 'BlockImageComparison',
35
43
  components: { BaseImageCaption },
36
44
  props: {
37
45
  data: {
38
- type: Object,
46
+ type: Object as PropType<BlockImageComparisonData>,
39
47
  required: true
40
48
  },
49
+ /** Link to more image details. Link text defaults to "Full image details" */
41
50
  customDetailUrl: {
42
51
  type: String,
43
52
  default: undefined
@@ -4,19 +4,12 @@ import BlockImageGallery from './BlockImageGallery.vue'
4
4
  export default {
5
5
  title: 'Components/Blocks/BlockImageGallery',
6
6
  component: BlockImageGallery,
7
+ tags: ['wagtail-blocks', 'carousels'],
7
8
  decorators: [
8
9
  () => ({
9
10
  template: `<div id="storyRoot" class="max-w-screen-3xl mx-auto"><story/></div>`
10
11
  })
11
12
  ],
12
- argTypes: {
13
- blockId: {
14
- text: { type: 'string' },
15
- required: false,
16
- description:
17
- 'Fancybox: the block id is used to differentiate the fancybox of this gallery from others on the page. Generated by Wagtail.'
18
- }
19
- },
20
13
 
21
14
  parameters: {
22
15
  html: {
@@ -41,7 +34,7 @@ export const BlockImageGalleryData = {
41
34
 
42
35
  export const ImageGalleryData = {
43
36
  label: 'Mars',
44
- 'block-id': 'x121p1yuly',
37
+ blockId: 'x121p1yuly',
45
38
  title: 'Image Gallery',
46
39
  description:
47
40
  'Gallery description, maximus quis nibh eu, luctus ultrices nulla. Curabitur tempus, massa vitae porttitor porttitor, tortor erat tincidunt magna, vulputate varius nulla leo et mauris.',
@@ -86,18 +86,22 @@ export default defineComponent({
86
86
  BlockImageCarousel
87
87
  },
88
88
  props: {
89
+ /** Small label text appears above the title on the gallery cover */
89
90
  label: {
90
91
  type: String,
91
92
  required: false
92
93
  },
94
+ /** Title of the gallery. Appears on gallery cover. */
93
95
  title: {
94
96
  type: String,
95
97
  required: false
96
98
  },
99
+ /** Short description of the gallery (plain text). Appears on gallery cover. */
97
100
  description: {
98
101
  type: String,
99
102
  required: false
100
103
  },
104
+ /** Image to use as the gallery cover */
101
105
  cover: {
102
106
  type: Object as PropType<ImageObject>,
103
107
  required: false
@@ -106,6 +110,7 @@ export default defineComponent({
106
110
  type: Array as PropType<ImageObject[]>,
107
111
  required: false
108
112
  },
113
+ /** Fancybox: the block id is used to differentiate the fancybox of this gallery from others on the page. Generated by Wagtail. */
109
114
  blockId: {
110
115
  type: String,
111
116
  required: false
@@ -4,14 +4,7 @@ import BlockInlineImage from './BlockInlineImage.vue'
4
4
  export default {
5
5
  title: 'Components/Blocks/BlockInlineImage',
6
6
  component: BlockInlineImage,
7
- argTypes: {
8
- variant: {
9
- type: 'string',
10
- description: 'Text size variant',
11
- control: { type: 'select' },
12
- options: ['small', 'medium', 'large']
13
- }
14
- },
7
+ tags: ['wagtail-blocks'],
15
8
  excludeStories: /.*(Data)$/
16
9
  }
17
10
 
@@ -55,13 +55,22 @@
55
55
 
56
56
  <script lang="ts">
57
57
  import { defineComponent, type PropType } from 'vue'
58
- import type { ImageObject } from '../../interfaces'
58
+ import type { BlockData, ImageObject } from '../../interfaces'
59
59
  import { mixinGetSrcSet } from './../../utils/mixins'
60
60
  import MixinFancybox from './../MixinFancybox/MixinFancybox.vue'
61
61
  import BaseImagePlaceholder from './../BaseImagePlaceholder/BaseImagePlaceholder.vue'
62
62
  import BaseImage from './../BaseImage/BaseImage.vue'
63
63
  import BaseImageCaption from './../BaseImageCaption/BaseImageCaption.vue'
64
- import BlockText from './../BlockText/BlockText.vue'
64
+ import BlockText, { type VariantKey as BlockTextVariantKey } from './../BlockText/BlockText.vue'
65
+
66
+ export type BlockInlineImageData = BlockData & {
67
+ /** rich text */
68
+ text?: string
69
+ caption?: string
70
+ displayCaption: boolean
71
+ image?: ImageObject
72
+ alignTo: 'left' | 'right'
73
+ }
65
74
 
66
75
  export default defineComponent({
67
76
  name: 'BlockInlineImage',
@@ -74,11 +83,15 @@ export default defineComponent({
74
83
  },
75
84
  props: {
76
85
  data: {
77
- type: Object,
78
- required: false
86
+ type: Object as PropType<BlockInlineImageData>,
87
+ required: false,
88
+ default: undefined
79
89
  },
90
+ /**
91
+ * Adjusts text size and vertical spacing. Corresponds with the same variants in `BlockText`
92
+ */
80
93
  variant: {
81
- type: String as PropType<'small' | 'medium' | 'large'>,
94
+ type: String as PropType<BlockTextVariantKey>,
82
95
  default: 'large'
83
96
  }
84
97
  },
@@ -93,7 +106,7 @@ export default defineComponent({
93
106
  return this.data.caption
94
107
  } else if (
95
108
  this.data &&
96
- this.data.image.caption &&
109
+ this.data.image?.caption &&
97
110
  this.data.image.caption.length > 2 &&
98
111
  this.data.displayCaption
99
112
  ) {
@@ -111,7 +124,7 @@ export default defineComponent({
111
124
  }
112
125
  return null
113
126
  },
114
- hasCaptionArea(): string | false {
127
+ hasCaptionArea(): string | false | undefined {
115
128
  if (this.data && this.data.image) {
116
129
  return this.theCaption || this.data.image.credit || this.data.image.detailUrl
117
130
  }
@@ -3,6 +3,7 @@ import BlockKeyPoints from './BlockKeyPoints.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockKeyPoints',
5
5
  component: BlockKeyPoints,
6
+ tags: ['wagtail-blocks'],
6
7
  excludeStories: /.*Data$/
7
8
  }
8
9
 
@@ -4,6 +4,7 @@
4
4
  class="BlockKeyPoints border-gray-light-mid lg:py-10 py-6 border-t border-b"
5
5
  >
6
6
  <BlockHeading
7
+ v-if="data.heading"
7
8
  class="mb-5"
8
9
  :data="{ heading: data.heading }"
9
10
  />
@@ -24,10 +25,17 @@
24
25
  </template>
25
26
 
26
27
  <script lang="ts">
27
- import { defineComponent } from 'vue'
28
+ import { defineComponent, type PropType } from 'vue'
29
+ import { BlockData } from './../../interfaces.ts'
28
30
  import BlockHeading from './../BlockHeading/BlockHeading.vue'
29
31
  import BlockText from './../BlockText/BlockText.vue'
30
32
 
33
+ export type BlockKeyPointsData = BlockData & {
34
+ listItem: {
35
+ text: string
36
+ }[]
37
+ }
38
+
31
39
  export default defineComponent({
32
40
  name: 'BlockKeyPoints',
33
41
  components: {
@@ -36,8 +44,9 @@ export default defineComponent({
36
44
  },
37
45
  props: {
38
46
  data: {
39
- type: Object,
40
- required: false
47
+ type: Object as PropType<BlockKeyPointsData>,
48
+ required: false,
49
+ default: undefined
41
50
  }
42
51
  }
43
52
  })
@@ -5,24 +5,8 @@ import BlockLinkCard from './BlockLinkCard.vue'
5
5
  export default {
6
6
  title: 'Components/Cards/BlockLinkCard',
7
7
  component: BlockLinkCard,
8
- tags: ['!autodocs'],
8
+ tags: ['cards'],
9
9
  excludeStories: /.*Data$/,
10
- argTypes: {
11
- size: {
12
- control: {
13
- type: 'select'
14
- },
15
- options: ['sm', 'md', 'lg']
16
- },
17
- headingLevel: {
18
- description:
19
- 'Change the heading level for semantic markup. This does not affect the style of the heading.',
20
- control: {
21
- type: 'select',
22
- options: [null, 'h1', 'h2', 'h3', 'h4', 'h5']
23
- }
24
- }
25
- },
26
10
  parameters: {
27
11
  html: {
28
12
  root: '#storyRoot' // to omit decorators from html output
@@ -217,6 +201,7 @@ export const EduExplainerArticle = {
217
201
  globals: { theme: 'ThemeEdu' },
218
202
  args: {
219
203
  ...BlockLinkCardData,
204
+
220
205
  data: {
221
206
  page: {
222
207
  __typename: 'EDUExplainerArticlePage',
@@ -235,7 +220,9 @@ export const EduExplainerArticle = {
235
220
  { gradeLevel: '8' }
236
221
  ]
237
222
  }
238
- }
223
+ },
224
+
225
+ size: 'md'
239
226
  }
240
227
  }
241
228
  export const LargeEduExplainerArticle = {
@@ -189,7 +189,12 @@
189
189
 
190
190
  <script lang="ts">
191
191
  import type { PropType } from 'vue'
192
- import type { Card, EventCardObject, EduResourceCardObject } from '../../interfaces'
192
+ import type {
193
+ ContentTypeKey,
194
+ Card,
195
+ EventCardObject,
196
+ EduResourceCardObject
197
+ } from './../../interfaces.ts'
193
198
  import { defineComponent } from 'vue'
194
199
  import { mapStores } from 'pinia'
195
200
  import { useThemeStore } from '../../store/theme'
@@ -223,88 +228,102 @@ export default defineComponent({
223
228
  BlockLinkCardCollectionLg
224
229
  },
225
230
  props: {
231
+ /** Card data (can accept page data with key `page`) */
226
232
  data: {
227
233
  type: Object as PropType<Card>,
228
234
  required: false,
229
235
  default: undefined
230
236
  },
231
- // override props as needed
232
- // so we can use this component in search results
237
+ /** Overrides `data` */
233
238
  url: {
234
239
  type: String,
235
240
  required: false,
236
241
  default: undefined
237
242
  },
243
+ /** Overrides `data` */
238
244
  externalLink: {
239
245
  type: String,
240
246
  required: false,
241
247
  default: undefined
242
248
  },
249
+ /** Overrides `data` */
243
250
  thumbnailImage: {
244
251
  type: Object,
245
252
  required: false,
246
253
  default: undefined
247
254
  },
255
+ /** Overrides `data` */
248
256
  label: {
249
257
  type: String,
250
258
  required: false,
251
259
  default: undefined
252
260
  },
261
+ /** Overrides `data` */
253
262
  title: {
254
263
  type: String,
255
264
  required: false,
256
265
  default: undefined
257
266
  },
267
+ /** Overrides `data` */
258
268
  date: {
259
269
  type: String,
260
270
  required: false,
261
271
  default: undefined
262
272
  },
273
+ /** Events: overrides `data` */
263
274
  eventType: {
264
275
  type: String,
265
276
  default: undefined
266
277
  },
278
+ /** Events: overrides `data` */
267
279
  startDate: {
268
280
  type: String,
269
281
  required: false,
270
282
  default: undefined
271
283
  },
284
+ /** Events: overrides `data` */
272
285
  endDate: {
273
286
  type: String,
274
287
  required: false,
275
288
  default: undefined
276
289
  },
290
+ /** Events: overrides `data` */
277
291
  ongoing: {
278
292
  type: Boolean,
279
293
  default: false
280
294
  },
295
+ /** Events: overrides `data` */
281
296
  startDatetime: {
282
297
  type: String,
283
298
  default: undefined
284
299
  },
300
+ /** Events: overrides `data` */
285
301
  endDatetime: {
286
302
  type: String,
287
303
  default: undefined
288
304
  },
305
+ /** Events: overrides `data` */
289
306
  location: {
290
307
  type: String,
291
308
  default: undefined
292
309
  },
293
- // if styling should be compact
310
+ /** Compactness of styling. `sm` and `md` recommended for grids or horizontal lists. `lg` is a horizontal layout recommended for wide lists */
294
311
  size: {
295
- type: String,
312
+ type: String as PropType<'sm' | 'md' | 'lg'>,
296
313
  default: 'md'
297
314
  },
298
- // if a heading should be used and at what level
315
+ /** Heading level for semantic markup. This does not affect the style of the heading. No heading element is used if `undefined` */
299
316
  headingLevel: {
300
317
  type: (String as PropType<HeadingLevel>) || null,
301
318
  required: false,
302
319
  default: undefined
303
320
  },
321
+ /** Events: overrides `data` */
304
322
  showCalendarChip: {
305
323
  type: Boolean,
306
324
  default: false
307
325
  },
326
+ /** Currently only applies to EDU Collection cards. If "featured" styles are turned on, the card background and text colors will be inverted. */
308
327
  useFeaturedStyles: {
309
328
  type: Boolean,
310
329
  default: false
@@ -374,11 +393,11 @@ export default defineComponent({
374
393
  }
375
394
  return undefined
376
395
  },
377
- metadataType() {
396
+ metadataType(): ContentTypeKey | undefined {
378
397
  // checks that this is a valid metadata type
379
398
  const validContentTypes = Object.keys(eduMetadataDictionary)
380
399
  return this.data?.page?.__typename && validContentTypes.includes(this.data?.page?.__typename)
381
- ? this.data?.page?.__typename
400
+ ? (this.data?.page?.__typename as ContentTypeKey)
382
401
  : undefined
383
402
  },
384
403
  metadataAttrs() {
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, reactive } from 'vue'
3
- import type { EduResourceCardObject } from '../../interfaces'
3
+ import type { ContentTypeKey, EduResourceCardObject } from '../../interfaces'
4
4
  import type { HeadingLevel } from './../BaseHeading/BaseHeading.vue'
5
5
  import BaseLink from './../BaseLink/BaseLink.vue'
6
6
  import BaseImage from './../BaseImage/BaseImage.vue'
@@ -10,7 +10,7 @@ import MetadataEduResource from './../MetadataEduResource/MetadataEduResource.vu
10
10
 
11
11
  interface BlockLinkCardCollectionLgProps {
12
12
  theItem?: EduResourceCardObject
13
- metadataType?: string
13
+ metadataType?: ContentTypeKey
14
14
  metadataAttrs?: any
15
15
  headingLevel?: HeadingLevel
16
16
  size?: string
@@ -3,7 +3,7 @@ import BlockLinkCardList from './BlockLinkCardList.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockLinkCardList',
5
5
  component: BlockLinkCardList,
6
- tags: ['!autodocs'],
6
+ tags: ['wagtail-blocks', 'listings'],
7
7
  excludeStories: /.*Data$/
8
8
  }
9
9
  export const BlockLinkCardData = {
@@ -103,8 +103,6 @@ export const BlockLinkCardCarouselData = [
103
103
  export const BaseStory = {
104
104
  name: 'BlockLinkCardList',
105
105
  args: {
106
- itemType: 'cards',
107
- heading: 'Related Pages',
108
106
  items: BlockLinkCardCarouselData
109
107
  }
110
108
  }
@@ -1,21 +1,9 @@
1
- import BlockLinkCarousel, { itemTypes } from './BlockLinkCarousel.vue'
1
+ import BlockLinkCarousel from './BlockLinkCarousel.vue'
2
2
 
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockLinkCarousel',
5
5
  component: BlockLinkCarousel,
6
- argTypes: {
7
- itemType: {
8
- type: 'string',
9
- description: 'Type of item used for each slide',
10
- control: {
11
- type: 'select'
12
- },
13
- options: Object.keys(itemTypes),
14
- table: {
15
- defaultValue: { summary: 'cards' }
16
- }
17
- }
18
- },
6
+ tags: ['wagtail-blocks', 'carousels', 'listings'],
19
7
  excludeStories: /.*Data$/
20
8
  }
21
9
 
@@ -15,20 +15,19 @@
15
15
  </MixinCarousel>
16
16
  </template>
17
17
  <script lang="ts">
18
- import { defineComponent, resolveComponent } from 'vue'
18
+ import { defineComponent, resolveComponent, type PropType } from 'vue'
19
+ import type { Card } from './../../interfaces.ts'
19
20
  import MixinCarousel from './../MixinCarousel/MixinCarousel.vue'
20
21
  import BlockLinkCard from './../BlockLinkCard/BlockLinkCard.vue'
21
22
  import BlockLinkTile from './../BlockLinkTile/BlockLinkTile.vue'
22
23
 
23
- interface Variants {
24
- [key: string]: string
25
- }
26
-
27
- export const itemTypes: Variants = {
24
+ export const itemTypes = {
28
25
  cards: 'BlockLinkCard',
29
26
  tiles: 'BlockLinkTile'
30
27
  }
31
28
 
29
+ type ItemTypesKey = keyof typeof itemTypes
30
+
32
31
  export default defineComponent({
33
32
  name: 'BlockLinkCarousel',
34
33
  components: {
@@ -37,14 +36,15 @@ export default defineComponent({
37
36
  BlockLinkTile
38
37
  },
39
38
  props: {
39
+ /** Type of item used for each slide */
40
40
  itemType: {
41
- type: String,
41
+ type: String as PropType<ItemTypesKey>,
42
42
  required: false,
43
43
  default: 'cards',
44
44
  validator: (prop: string): boolean => Object.keys(itemTypes).includes(prop)
45
45
  },
46
46
  items: {
47
- type: Array,
47
+ type: Array as PropType<Card[]>,
48
48
  required: false,
49
49
  default: undefined
50
50
  },
@@ -5,22 +5,12 @@ import BlockLinkTile from './BlockLinkTile.vue'
5
5
  export default {
6
6
  title: 'Components/Cards/BlockLinkTile',
7
7
  component: BlockLinkTile,
8
+ tags: ['cards'],
8
9
  decorators: [
9
10
  () => ({
10
11
  template: `<div id="storyRoot" class="relative grid grid-cols-2 gap-3 lg:grid-cols-3"><story/></div>`
11
12
  })
12
13
  ],
13
- tags: ['!autodocs'],
14
- argTypes: {
15
- headingLevel: {
16
- description:
17
- 'Change the heading level for semantic markup. This does not affect the style of the heading.',
18
- control: {
19
- type: 'select'
20
- },
21
- options: [null, 'h1', 'h2', 'h3', 'h4', 'h5']
22
- }
23
- },
24
14
  parameters: {
25
15
  html: {
26
16
  root: '#storyRoot'
@@ -99,47 +99,60 @@ export default defineComponent({
99
99
  BaseImagePlaceholder
100
100
  },
101
101
  props: {
102
- // if some cards contain external links, be sure to alias the external url as 'externalLink'
102
+ /** Card data (can accept page data with key `page`) */
103
103
  data: {
104
104
  type: Object as PropType<Card | EventCardObject>,
105
- required: false
105
+ required: false,
106
+ default: undefined
106
107
  },
107
- // override props as needed
108
- // so we can use this component in search results
108
+ /** Overrides `data` */
109
109
  url: {
110
110
  type: String,
111
- required: false
111
+ required: false,
112
+ default: undefined
112
113
  },
114
+ /** Overrides `data` */
113
115
  externalLink: {
114
116
  type: String,
115
- required: false
117
+ required: false,
118
+ default: undefined
116
119
  },
120
+ /** Overrides `data` */
117
121
  thumbnailImage: {
118
122
  type: Object,
119
- required: false
123
+ required: false,
124
+ default: undefined
120
125
  },
126
+ /** Overrides `data` */
121
127
  label: {
122
128
  type: String,
123
- required: false
129
+ required: false,
130
+ default: undefined
124
131
  },
132
+ /** Overrides `data` */
125
133
  title: {
126
134
  type: String,
127
- required: false
135
+ required: false,
136
+ default: undefined
128
137
  },
138
+ /** Event: overrides `data` */
129
139
  startDate: {
130
140
  type: String,
131
- required: false
141
+ required: false,
142
+ default: undefined
132
143
  },
144
+ /** Event: overrides `data` */
133
145
  endDate: {
134
146
  type: String,
135
- required: false
147
+ required: false,
148
+ default: undefined
136
149
  },
137
- // if styling should be compact
150
+ /** If compact styling should be used (adjusts text size) */
138
151
  compact: {
139
152
  type: Boolean,
140
153
  default: false
141
154
  },
142
- // if a heading should be used and at what level
155
+ /** Heading level for semantic markup. This does not affect the style of the heading. No heading element is used if `undefined` */
143
156
  headingLevel: {
144
157
  type: (String as PropType<HeadingLevel>) || null,
145
158
  required: false
@@ -3,6 +3,7 @@ import BlockListCards from './BlockListCards.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockListCards',
5
5
  component: BlockListCards,
6
+ tags: ['wagtail-blocks', 'listings'],
6
7
  excludeStories: /.*Data$/
7
8
  }
8
9
 
@@ -96,9 +96,9 @@
96
96
  </template>
97
97
 
98
98
  <script lang="ts">
99
- import { defineComponent } from 'vue'
99
+ import { defineComponent, type PropType } from 'vue'
100
100
  import { mixinGetExternalLink } from './../../utils/mixins'
101
- import type { RelatedLinkObject } from '../../interfaces'
101
+ import type { BlockData, RelatedLinkObject } from '../../interfaces'
102
102
  import BaseHeading from './../BaseHeading/BaseHeading.vue'
103
103
  import BaseLink from './../BaseLink/BaseLink.vue'
104
104
  import BaseImage from './../BaseImage/BaseImage.vue'
@@ -116,8 +116,9 @@ export default defineComponent({
116
116
  },
117
117
  props: {
118
118
  data: {
119
- type: Object,
120
- required: false
119
+ type: Object as PropType<BlockData>,
120
+ required: false,
121
+ default: undefined
121
122
  }
122
123
  },
123
124
  methods: {
@@ -3,6 +3,7 @@ import BlockNewsletterSignup from './BlockNewsletterSignup.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockNewsletterSignup',
5
5
  component: BlockNewsletterSignup,
6
+ tags: ['wagtail-blocks'],
6
7
  excludeStories: /.*Data$/
7
8
  }
8
9
 
@@ -60,8 +60,9 @@
60
60
  </template>
61
61
  <script lang="ts">
62
62
  // @ts-nocheck
63
- import { defineComponent } from 'vue'
63
+ import { defineComponent, type PropType } from 'vue'
64
64
  import { mapStores } from 'pinia'
65
+ import type { BlockData } from './../../interfaces.ts'
65
66
  import { useThemeStore } from '../../store/theme'
66
67
  import BaseButton from './../BaseButton/BaseButton.vue'
67
68
  import BaseRadioGroup from './../BaseRadioGroup/BaseRadioGroup.vue'
@@ -115,7 +116,7 @@ export default defineComponent({
115
116
  },
116
117
  props: {
117
118
  data: {
118
- type: Object,
119
+ type: Object as PropType<BlockData>,
119
120
  required: true,
120
121
  default: () => ({})
121
122
  }
@@ -3,6 +3,7 @@ import BlockQuote from './BlockQuote.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockQuote',
5
5
  component: BlockQuote,
6
+ tags: ['wagtail-blocks'],
6
7
  excludeStories: /.*Data$/,
7
8
  parameters: {
8
9
  docs: {