@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
@@ -50,8 +50,9 @@
50
50
  </div>
51
51
  </template>
52
52
  <script lang="ts">
53
- import { defineComponent } from 'vue'
54
- import type { PropType } from 'vue'
53
+ /** A big, fancy pull quote, with optional attribution and link. Can also be used for non-quotation callouts. */
54
+
55
+ import { defineComponent, type PropType } from 'vue'
55
56
  import BaseLink from './../BaseLink/BaseLink.vue'
56
57
 
57
58
  export interface BlockQuoteAttributes {
@@ -3,6 +3,7 @@ import BlockRelatedLinks from './BlockRelatedLinks.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockRelatedLinks',
5
5
  component: BlockRelatedLinks,
6
+ tags: ['wagtail-blocks', 'listings'],
6
7
  excludeStories: /.*Data$/,
7
8
  parameters: {
8
9
  docs: {
@@ -43,11 +43,12 @@
43
43
  </div>
44
44
  </template>
45
45
  <script lang="ts">
46
- import { defineComponent } from 'vue'
47
- import type { PropType } from 'vue'
46
+ /** A list of links formatted with background colors and icons indicating the type of link. */
47
+
48
+ import { defineComponent, type PropType } from 'vue'
48
49
  import type { BlockData, RelatedLinkObject } from './../../interfaces'
49
50
  import RelatedLink from './../BlockRelatedLinks/RelatedLink.vue'
50
- import BaseHeading from './../BaseHeading/BaseHeading.vue'
51
+ import BaseHeading, { type HeadingLevel } from './../BaseHeading/BaseHeading.vue'
51
52
 
52
53
  export interface BlockRelatedLinksObject extends BlockData {
53
54
  heading: string
@@ -66,8 +67,9 @@ export default defineComponent({
66
67
  required: true,
67
68
  default: () => ({})
68
69
  },
70
+ /** Semantic heading level. Does not affect appearance. */
69
71
  headingSize: {
70
- type: String,
72
+ type: String as PropType<HeadingLevel>,
71
73
  required: false,
72
74
  default: undefined
73
75
  }
@@ -4,7 +4,7 @@ import { BlockImageData } from './../BlockImage/BlockImage.stories'
4
4
  export default {
5
5
  title: 'Components/Blocks/BlockRichTable',
6
6
  component: BlockRichTable,
7
- tags: ['!autodocs'],
7
+ tags: ['wagtail-blocks'],
8
8
  excludeStories: /.*Data$/
9
9
  }
10
10
 
@@ -1,8 +1,20 @@
1
1
  <script lang="ts">
2
- import { defineComponent } from 'vue'
2
+ import { defineComponent, type PropType } from 'vue'
3
+ import type { BlockData, ImageBlock, StreamfieldBlockData } from './../../interfaces.ts'
3
4
  import BlockImageStandard from './../BlockImage/BlockImageStandard.vue'
4
5
  import BlockText from './../BlockText/BlockText.vue'
5
6
 
7
+ type HeadCell = {
8
+ text?: string
9
+ }
10
+ type RichTableObject = BlockData & {
11
+ tableCaption?: string
12
+ tableContent?: {
13
+ tableHead?: HeadCell[]
14
+ tableBody?: BlockData[][]
15
+ }
16
+ }
17
+
6
18
  export default defineComponent({
7
19
  name: 'BlockRichTable',
8
20
  components: {
@@ -11,7 +23,7 @@ export default defineComponent({
11
23
  },
12
24
  props: {
13
25
  table: {
14
- type: Object,
26
+ type: Object as PropType<RichTableObject>,
15
27
  required: true
16
28
  }
17
29
  }
@@ -44,7 +56,9 @@ export default defineComponent({
44
56
  scope="col"
45
57
  class="min-w-[6rem] bg-jpl-blue-darker edu:bg-jpl-violet-darker text-subtitle text-white border-gray-light-mid lg:p-5 p-3 border-b text-left"
46
58
  >
47
- {{ headCell.text }}
59
+ <template v-if="headCell">
60
+ {{ (headCell as HeadCell).text }}
61
+ </template>
48
62
  </th>
49
63
  </tr>
50
64
  </thead>
@@ -60,22 +74,22 @@ export default defineComponent({
60
74
  >
61
75
  <template v-if="cell.blockType === 'CharBlock'">
62
76
  <p class="">
63
- {{ cell.value }}
77
+ {{ (cell as StreamfieldBlockData).value }}
64
78
  </p>
65
79
  </template>
66
80
  <template v-else-if="cell.blockType === 'RichTextBlock'">
67
81
  <BlockText
68
82
  variant="small"
69
- :text="cell.value"
83
+ :text="(cell as StreamfieldBlockData).value"
70
84
  />
71
85
  </template>
72
86
  <template v-else-if="cell.blockType === 'ImageBlock'">
73
87
  <BlockImageStandard
74
88
  class=""
75
- :data="cell.image"
76
- :display-caption="cell.displayCaption"
77
- :caption="cell.caption"
78
- :constrain="cell.constrain"
89
+ :data="(cell as ImageBlock).image"
90
+ :display-caption="(cell as ImageBlock).displayCaption"
91
+ :caption="(cell as ImageBlock).caption"
92
+ :constrain="(cell as ImageBlock).constrain"
79
93
  />
80
94
  </template>
81
95
  </td>
@@ -19,22 +19,12 @@ import { BlockVideoEmbedData } from './../BlockVideoEmbed/BlockVideoEmbed.storie
19
19
  import { BlockNewsletterSignupData } from '../BlockNewsletterSignup/BlockNewsletterSignup.stories'
20
20
  import { MixedColumnWidths } from './../BlockRichTable/BlockRichTable.stories'
21
21
  import { BlockCsrTableData } from './../BlockCsrTable/BlockCsrTable.stories'
22
- import BlockStreamfield, { variants } from './BlockStreamfield.vue'
22
+ import BlockStreamfield from './BlockStreamfield.vue'
23
23
 
24
24
  export default {
25
25
  title: 'Components/Blocks/BlockStreamfield',
26
26
  component: BlockStreamfield,
27
27
  tags: ['!autodocs'],
28
- argTypes: {
29
- variant: {
30
- control: { type: 'select' },
31
- options: Object.keys(variants)
32
- },
33
- size: {
34
- control: { type: 'select' },
35
- options: ['small', 'medium', 'large']
36
- }
37
- },
38
28
  parameters: {
39
29
  layout: 'fullscreen'
40
30
  },
@@ -36,7 +36,7 @@
36
36
  v-else-if="block.blockType == 'InlineImageBlock'"
37
37
  :key="`inlineImageBlock${index}`"
38
38
  :class="seamlessText(index) ? 'lg:mb-8 mb-5' : marginBottom"
39
- :data="block"
39
+ :data="block as BlockInlineImageData"
40
40
  :variant="size"
41
41
  />
42
42
 
@@ -55,7 +55,7 @@
55
55
  indent="col-3"
56
56
  :class="marginBottom"
57
57
  >
58
- <BlockKeyPoints :data="block" />
58
+ <BlockKeyPoints :data="block as BlockKeyPointsData" />
59
59
  </LayoutHelper>
60
60
 
61
61
  <LayoutHelper
@@ -73,7 +73,7 @@
73
73
  indent="col-4"
74
74
  :class="marginBottom"
75
75
  >
76
- <BlockCta :data="block" />
76
+ <BlockCta :data="block as BlockCtaData" />
77
77
  </LayoutHelper>
78
78
  <LayoutHelper
79
79
  v-else-if="block.blockType == 'NewsletterSignupBlock'"
@@ -91,7 +91,7 @@
91
91
  :class="marginBottom"
92
92
  >
93
93
  <BlockTeaser
94
- :custom-label="block.customLabel"
94
+ :label="block.customLabel"
95
95
  :heading="block.heading"
96
96
  :introduction="block.introduction"
97
97
  :button-text="block.buttonText"
@@ -134,7 +134,7 @@
134
134
  indent="col-2"
135
135
  :class="marginBottom"
136
136
  >
137
- <BlockVideo :data="block" />
137
+ <BlockVideo :data="block as BlockVideoData" />
138
138
  </LayoutHelper>
139
139
 
140
140
  <LayoutHelper
@@ -143,14 +143,14 @@
143
143
  indent="col-2"
144
144
  :class="marginBottom"
145
145
  >
146
- <BlockVideoEmbed :data="block as unknown as VideoBlockEmbedData" />
146
+ <BlockVideoEmbed :data="block as unknown as BlockVideoEmbedData" />
147
147
  </LayoutHelper>
148
148
 
149
149
  <BlockImage
150
150
  v-else-if="block.blockType == 'FullBleedImageBlock'"
151
151
  :key="`fullBleedImageBlock${index}`"
152
152
  :class="marginBottom"
153
- :data="block"
153
+ :data="block as ImageBlock"
154
154
  :full-bleed="block.fullBleed"
155
155
  />
156
156
 
@@ -160,7 +160,7 @@
160
160
  indent="col-2"
161
161
  :class="marginBottom"
162
162
  >
163
- <BlockImageComparison :data="block" />
163
+ <BlockImageComparison :data="block as BlockImageComparisonData" />
164
164
  </LayoutHelper>
165
165
 
166
166
  <LayoutHelper
@@ -169,7 +169,7 @@
169
169
  indent="col-2"
170
170
  :class="marginBottom"
171
171
  >
172
- <BlockIframeEmbed :data="block" />
172
+ <BlockIframeEmbed :data="block as BlockIframeEmbedData" />
173
173
  </LayoutHelper>
174
174
 
175
175
  <LayoutHelper
@@ -221,7 +221,7 @@
221
221
  :key="`linkCarouselBlock${index}`"
222
222
  :class="marginBottom"
223
223
  >
224
- <BlockLinkCarousel :items="block.blocks" />
224
+ <BlockLinkCarousel :items="block.blocks as Card[]" />
225
225
  </div>
226
226
 
227
227
  <LayoutHelper
@@ -230,7 +230,7 @@
230
230
  indent="col-2"
231
231
  :class="marginBottom"
232
232
  >
233
- <BlockLinkCardList :items="block.blocks" />
233
+ <BlockLinkCardList :items="block.blocks as Card[]" />
234
234
  </LayoutHelper>
235
235
 
236
236
  <LayoutHelper
@@ -269,19 +269,23 @@
269
269
  <script lang="ts">
270
270
  import { defineComponent } from 'vue'
271
271
  import type { PropType } from 'vue'
272
- import type { StreamfieldBlockData } from '../../interfaces'
272
+ import type { ImageBlock, StreamfieldBlockData, Card } from '../../interfaces'
273
273
  import LayoutHelper from './../LayoutHelper/LayoutHelper.vue'
274
274
  import BlockAnchor from './../BlockAnchor/BlockAnchor.vue'
275
275
  import BlockAccordion, { type AccordionBlockObject } from './../BlockAccordion/BlockAccordion.vue'
276
276
  import BlockCardGrid from './../BlockCardGrid/BlockCardGrid.vue'
277
- import BlockCta from './../BlockCta/BlockCta.vue'
277
+ import BlockCta, { type BlockCtaData } from './../BlockCta/BlockCta.vue'
278
278
  import BlockHeading, { BlockHeadingObject } from './../BlockHeading/BlockHeading.vue'
279
279
  import BlockImage from './../BlockImage/BlockImage.vue'
280
280
  import BlockImageCarousel from './../BlockImageCarousel/BlockImageCarousel.vue'
281
- import BlockImageComparison from './../BlockImageComparison/BlockImageComparison.vue'
281
+ import BlockImageComparison, {
282
+ type BlockImageComparisonData
283
+ } from './../BlockImageComparison/BlockImageComparison.vue'
282
284
  import BlockImageGallery from './../BlockImageGallery/BlockImageGallery.vue'
283
- import BlockInlineImage from './../BlockInlineImage/BlockInlineImage.vue'
284
- import BlockKeyPoints from './../BlockKeyPoints/BlockKeyPoints.vue'
285
+ import BlockInlineImage, {
286
+ type BlockInlineImageData
287
+ } from './../BlockInlineImage/BlockInlineImage.vue'
288
+ import BlockKeyPoints, { type BlockKeyPointsData } from './../BlockKeyPoints/BlockKeyPoints.vue'
285
289
  import BlockLinkCardList from './../BlockLinkCardList/BlockLinkCardList.vue'
286
290
  import BlockLinkCarousel from './../BlockLinkCarousel/BlockLinkCarousel.vue'
287
291
  import BlockListCards from './../BlockListCards/BlockListCards.vue'
@@ -292,25 +296,23 @@ import BlockRelatedLinks, {
292
296
  import BlockRichTable from './../BlockRichTable/BlockRichTable.vue'
293
297
  import BlockTeaser from './../BlockTeaser/BlockTeaser.vue'
294
298
  import BlockText from './../BlockText/BlockText.vue'
295
- import BlockIframeEmbed from './../BlockIframeEmbed/BlockIframeEmbed.vue'
299
+ import BlockIframeEmbed, {
300
+ type BlockIframeEmbedData
301
+ } from './../BlockIframeEmbed/BlockIframeEmbed.vue'
296
302
  import BlockGist from './../BlockGist/BlockGist.vue'
297
- import BlockVideo from './../BlockVideo/BlockVideo.vue'
298
- import BlockVideoEmbed, {
299
- type BlockData as VideoBlockEmbedData
300
- } from './../BlockVideoEmbed/BlockVideoEmbed.vue'
303
+ import BlockVideo, { type BlockVideoData } from './../BlockVideo/BlockVideo.vue'
304
+ import BlockVideoEmbed, { type BlockVideoEmbedData } from './../BlockVideoEmbed/BlockVideoEmbed.vue'
301
305
  import BlockNewsletterSignup from '../BlockNewsletterSignup/BlockNewsletterSignup.vue'
302
306
  import BlockCsrTable from '../BlockCsrTable/BlockCsrTable.vue'
303
307
  import { mapStores } from 'pinia'
304
308
  import { useThemeStore } from '../../store/theme'
309
+ import { type VariantKey as BlockTextVariantKey } from './../BlockText/BlockText.vue'
305
310
 
306
- interface Variants {
307
- [key: string]: string
308
- }
309
-
310
- export const variants: Variants = {
311
+ export const variants = {
311
312
  default: '',
312
313
  fluid: '-fluid'
313
314
  }
315
+ type VariantsKey = keyof typeof variants
314
316
 
315
317
  export default defineComponent({
316
318
  name: 'BlockStreamfield',
@@ -343,21 +345,22 @@ export default defineComponent({
343
345
  BlockCsrTable
344
346
  },
345
347
  props: {
348
+ /** Changes behavior of width. Fluid width: all block widths will match that of the container. Otherwise they will conform to preset widths. */
346
349
  variant: {
347
- type: String,
350
+ type: String as PropType<VariantsKey>,
348
351
  required: false,
349
352
  default: 'default',
350
353
  validator: (prop: string): boolean => Object.keys(variants).includes(prop)
351
354
  },
355
+ /** Text size. Corresponds to available variants of `BlockText` */
352
356
  size: {
353
- type: String as PropType<'small' | 'medium' | 'large'>,
354
- required: false,
357
+ type: String as PropType<BlockTextVariantKey>,
355
358
  default: 'large'
356
359
  },
357
- // eslint-disable-next-line vue/require-default-prop
358
360
  data: {
359
361
  type: Array as PropType<StreamfieldBlockData[]>,
360
- required: false
362
+ required: false,
363
+ default: undefined
361
364
  }
362
365
  },
363
366
  computed: {
@@ -3,6 +3,7 @@ import BlockTeaser from './BlockTeaser.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockTeaser',
5
5
  component: BlockTeaser,
6
+ tags: ['wagtail-blocks'],
6
7
  excludeStories: /.*Data$/
7
8
  }
8
9
 
@@ -75,39 +75,47 @@ export default defineComponent({
75
75
  BaseImage
76
76
  },
77
77
  props: {
78
- // piecemeal props for reuse
79
- customLabel: {
80
- type: String,
81
- required: false
82
- },
78
+ /** Small text at the top of the teaser */
83
79
  label: {
84
80
  type: String,
85
- required: false
81
+ required: false,
82
+ default: undefined
86
83
  },
84
+ /** Large heading text */
87
85
  heading: {
88
86
  type: String,
89
- required: false
87
+ required: false,
88
+ default: undefined
90
89
  },
90
+ /** Short descriptive text */
91
91
  introduction: {
92
92
  type: String,
93
- required: false
93
+ required: false,
94
+ default: undefined
94
95
  },
96
+ /** Button text */
95
97
  buttonText: {
96
98
  type: String,
97
- required: false
99
+ required: false,
100
+ default: undefined
98
101
  },
102
+ /** Background image */
99
103
  image: {
100
104
  type: Object,
101
- required: false
105
+ required: false,
106
+ default: undefined
102
107
  },
108
+ /** If the background image should span the entire width of the block */
103
109
  fullWidth: {
104
110
  type: Boolean,
105
111
  default: false
106
112
  },
113
+ /** Option to pass a page data object as an object or as a single item in an array (for better compatibility with CMS mixed use) */
107
114
  // ideally can pass a page object (TopicDetailPage), but sometimes (e.g. streamfield teaserblock) this will be wrapped in an array
108
115
  teaserPage: {
109
116
  type: [Array, Object],
110
- required: false
117
+ required: false,
118
+ default: undefined
111
119
  }
112
120
  },
113
121
  computed: {
@@ -115,7 +123,7 @@ export default defineComponent({
115
123
  * Fall back to the linked page’s label, if there is one.
116
124
  */
117
125
  theLabel(): string {
118
- return this.customLabel || this.label || this.theTeaserPage?.label || ''
126
+ return this.label || this.theTeaserPage?.label || ''
119
127
  },
120
128
 
121
129
  /**
@@ -1,16 +1,9 @@
1
- import BlockText, { variants } from './BlockText.vue'
1
+ import BlockText from './BlockText.vue'
2
2
 
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockText',
5
5
  component: BlockText,
6
- tags: ['!autodocs'],
7
- argTypes: {
8
- variant: {
9
- control: { type: 'select' },
10
- options: Object.keys(variants)
11
- },
12
- text: { control: { type: 'text' } }
13
- },
6
+ tags: ['wagtail-blocks'],
14
7
  decorators: [
15
8
  () => ({
16
9
  template: '<div class="lg:w-2/3 mx-auto"><story /></div>'
@@ -6,37 +6,49 @@
6
6
  ></div>
7
7
  </template>
8
8
  <script lang="ts">
9
+ /**
10
+ * Description of this component
11
+ */
9
12
  import { defineComponent } from 'vue'
10
13
 
11
- interface Variants {
12
- [key: string]: string
13
- }
14
-
15
14
  export interface BlockTextObject {
16
15
  blockType?: string
17
16
  value: string
18
17
  }
19
- export const variants: Variants = {
18
+
19
+ const variants = {
20
20
  small: 'text-body-sm -small',
21
21
  medium: 'text-body-md -medium',
22
22
  large: 'text-body-lg -large'
23
- }
23
+ } as const
24
+
25
+ export type VariantKey = keyof typeof variants
24
26
 
25
27
  export default defineComponent({
26
28
  name: 'BlockText',
27
29
  props: {
30
+ /**
31
+ * Block contents. Supports rich text.
32
+ */
28
33
  text: {
29
34
  type: String,
30
- required: false
35
+ required: false,
36
+ default: undefined
31
37
  },
38
+ /**
39
+ * Adjusts text size and vertical spacing. Corresponds with the same variants in `BlockInlineImage`
40
+ */
32
41
  variant: {
33
- type: String,
42
+ type: String as () => VariantKey,
34
43
  required: false,
35
44
  default: 'large',
36
- validator: (prop: string): boolean => Object.keys(variants).includes(prop)
45
+ validator: (prop: VariantKey) => Object.keys(variants).includes(prop)
37
46
  }
38
47
  },
39
48
  computed: {
49
+ /**
50
+ * Class string generated by variant selection.
51
+ */
40
52
  computedClass(): string {
41
53
  return variants[this.variant]
42
54
  }
@@ -4,6 +4,7 @@ import BlockVideo from './BlockVideo.vue'
4
4
  export default {
5
5
  title: 'Components/Blocks/BlockVideo',
6
6
  component: BlockVideo,
7
+ tags: ['wagtail-blocks'],
7
8
  excludeStories: /.*Data$/
8
9
  }
9
10
 
@@ -21,12 +21,19 @@
21
21
  </div>
22
22
  </template>
23
23
  <script lang="ts">
24
- import { defineComponent } from 'vue'
24
+ import { defineComponent, type PropType } from 'vue'
25
25
  import { mapStores } from 'pinia'
26
+ import type { BlockData, VideoObject } from './../../interfaces.ts'
26
27
  import { useThemeStore } from '../../store/theme'
27
28
  import BaseVideo from './../BaseVideo/BaseVideo.vue'
28
29
  import BaseImageCaption from './../BaseImageCaption/BaseImageCaption.vue'
29
30
 
31
+ export type BlockVideoData = BlockData & {
32
+ video: VideoObject
33
+ autoplay: boolean
34
+ caption: string
35
+ credit: string
36
+ }
30
37
  export default defineComponent({
31
38
  name: 'BlockVideo',
32
39
  components: {
@@ -34,14 +41,18 @@ export default defineComponent({
34
41
  BaseImageCaption
35
42
  },
36
43
  props: {
44
+ /** BlockData is used to render an HTML5 video element */
37
45
  data: {
38
- type: Object,
39
- required: false
46
+ type: Object as PropType<BlockVideoData>,
47
+ required: false,
48
+ default: undefined
40
49
  },
50
+ /** If the video should autoplay */
41
51
  autoplay: {
42
52
  type: Boolean,
43
53
  default: false
44
54
  },
55
+ /** Adds a link. Link text defaults to "Full Video Details" */
45
56
  customDetailUrl: {
46
57
  type: String,
47
58
  default: undefined
@@ -3,6 +3,7 @@ import BlockVideoEmbed from './BlockVideoEmbed.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockVideoEmbed',
5
5
  component: BlockVideoEmbed,
6
+ tags: ['wagtail-blocks'],
6
7
  excludeStories: /.*Data$/
7
8
  }
8
9
 
@@ -24,14 +24,15 @@
24
24
  <script lang="ts">
25
25
  import type { PropType } from 'vue'
26
26
  import { defineComponent } from 'vue'
27
+ import type { BlockData } from './../../interfaces'
27
28
  import BaseImagePlaceholder from './../BaseImagePlaceholder/BaseImagePlaceholder.vue'
28
29
  import BaseImageCaption from './../BaseImageCaption/BaseImageCaption.vue'
29
30
 
30
- export interface BlockData {
31
+ export type BlockVideoEmbedData = BlockData & {
31
32
  heading: string
32
33
  display?: boolean
33
34
  embed: {
34
- // HTML for the iframe, generated by OEmbed.
35
+ /** HTML for the iframe, generated by OEmbed */
35
36
  embed: string
36
37
  }
37
38
  caption: string
@@ -45,11 +46,13 @@ export default defineComponent({
45
46
  BaseImageCaption
46
47
  },
47
48
  props: {
49
+ /** BlockData (`embed.embed`) provides the HTML markup for the embed */
48
50
  data: {
49
- type: Object as PropType<Partial<BlockData>>,
51
+ type: Object as PropType<BlockVideoEmbedData>,
50
52
  required: false,
51
53
  default: undefined
52
54
  },
55
+ /** Adds a link. Link text defaults to "Full Video Details" */
53
56
  customDetailUrl: {
54
57
  type: String,
55
58
  default: undefined
@@ -24,34 +24,41 @@ export default defineComponent({
24
24
  BaseButton
25
25
  },
26
26
  props: {
27
+ /** Used to generate ICS file */
27
28
  isAllDay: {
28
29
  type: Boolean,
29
30
  required: false,
30
31
  default: false
31
32
  },
33
+ /** Used to generate ICS file */
32
34
  startDate: {
33
35
  type: String,
34
36
  default: undefined
35
37
  },
38
+ /** Used to generate ICS file */
36
39
  startDatetime: {
37
40
  type: String,
38
41
  default: undefined
39
42
  },
43
+ /** Used to generate ICS file */
40
44
  endDatetime: {
41
45
  type: String,
42
46
  required: false,
43
47
  default: undefined
44
48
  },
49
+ /** Used to generate ICS file */
45
50
  title: {
46
51
  type: String,
47
52
  required: false,
48
53
  default: undefined
49
54
  },
55
+ /** Used to generate ICS file */
50
56
  location: {
51
57
  type: String,
52
58
  required: false,
53
59
  default: undefined
54
60
  },
61
+ /** Used to generate ICS file */
55
62
  description: {
56
63
  type: String,
57
64
  required: false,
@@ -1,27 +1,9 @@
1
- import DetailHeadline, { pillColorVariants } from './DetailHeadline.vue'
1
+ import DetailHeadline from './DetailHeadline.vue'
2
2
 
3
3
  export default {
4
4
  title: 'Components/Utilities/DetailHeadline',
5
5
  component: DetailHeadline,
6
- excludeStories: /.*Data$/,
7
- argTypes: {
8
- ariaLabel: {
9
- type: 'string',
10
- description:
11
- "ARIA label. Recommended if your button label isn't descriptive, or if it only contains an icon."
12
- },
13
- pillColor: {
14
- type: 'string',
15
- description: 'Color of pill',
16
- control: {
17
- type: 'select'
18
- },
19
- options: pillColorVariants,
20
- table: {
21
- defaultValue: { summary: 'primary' }
22
- }
23
- }
24
- }
6
+ excludeStories: /.*Data$/
25
7
  }
26
8
 
27
9
  export const DetailHeadlineData = {