@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
@@ -61,37 +61,44 @@
61
61
  </template>
62
62
 
63
63
  <script lang="ts">
64
- import { defineComponent } from 'vue'
65
- import type { PropType } from 'vue'
64
+ /** The BaseRadioGroup component is expected to contain an array of options and a grouping name with the goal of selecting a single option. */
65
+
66
+ import { defineComponent, type PropType } from 'vue'
66
67
  import type { FormOption } from '../../interfaces'
67
68
  export default defineComponent({
68
69
  name: 'BaseRadioGroup',
69
70
  props: {
71
+ /** iContact group id */
70
72
  group: {
71
73
  type: String,
72
74
  default: null,
73
75
  required: false
74
76
  },
77
+ /** The value that should be preselected */
75
78
  preselected: {
76
79
  type: String,
77
80
  default: null,
78
81
  required: false
79
82
  },
83
+ /** Heading */
80
84
  heading: {
81
85
  type: String,
82
86
  default: null,
83
87
  required: false
84
88
  },
89
+ /** Descriptive text or summary */
85
90
  subHeading: {
86
91
  type: String,
87
92
  default: null,
88
93
  required: false
89
94
  },
95
+ /** Fieldset title, for screen readers */
90
96
  title: {
91
97
  type: String,
92
98
  default: null,
93
99
  required: false
94
100
  },
101
+ /** Array of `{FormOption}s` */
95
102
  options: {
96
103
  type: Array as PropType<FormOption[]>,
97
104
  default: null,
@@ -7,7 +7,8 @@ export default {
7
7
  parameters: {
8
8
  docs: {
9
9
  description: {
10
- component: `The BaseSwimlane component is expected to contain an array of words to create a 'swimlane' effect as the text swims through.`
10
+ component:
11
+ "The BaseSwimlane component is expected to contain an array of words to create a 'swimlane' effect as the text swims through."
11
12
  }
12
13
  }
13
14
  }
@@ -17,6 +17,8 @@
17
17
  </template>
18
18
 
19
19
  <script lang="ts">
20
+ /** The BaseSwimlane component is expected to contain an array of words to create a 'swimlane' effect as the text swims through. */
21
+
20
22
  // @ts-nocheck
21
23
  import { defineComponent } from 'vue'
22
24
 
@@ -7,7 +7,12 @@ export default {
7
7
  () => ({
8
8
  template: `<div id="storyRoot" class="w-full"><story/></div>`
9
9
  })
10
- ]
10
+ ],
11
+ parameters: {
12
+ html: {
13
+ root: '#storyRoot'
14
+ }
15
+ }
11
16
  }
12
17
 
13
18
  export const BaseStory = {
@@ -85,22 +85,24 @@ type Interval = ReturnType<typeof setInterval>
85
85
  export default defineComponent({
86
86
  name: 'BaseTimer',
87
87
  props: {
88
+ /** Start time or goal time (depends if it's a countdown or not). Format: `YYYY-MM-DD HH:MM:SS+01:00` */
88
89
  targetDateTime: {
89
90
  type: String,
90
91
  required: true
91
92
  },
92
- // if blank, the first three significant units will show
93
+ /** If blank, the first three applicable time units will show */
93
94
  selectedUnits: {
94
95
  type: Array as PropType<UnitID[]>,
95
96
  required: false,
96
97
  validator: (val: UnitID[]): boolean => val.every((v) => Boolean(timerUnits[v]))
97
98
  },
99
+ /** If time and units should all appear on one line */
98
100
  inline: {
99
101
  type: Boolean,
100
102
  required: false,
101
103
  default: false
102
104
  },
103
- // if a countdown clock, then this will force it to stop at 0
105
+ /** If this is a countdown clock, the timer will start `now()` and count down to 0 when it reaches the `targetDateTime`) */
104
106
  countdown: {
105
107
  type: Boolean,
106
108
  required: false,
@@ -2,22 +2,7 @@ import BaseUnitToggle, { unitPairs } from './BaseUnitToggle.vue'
2
2
 
3
3
  export default {
4
4
  title: 'Components/Base/BaseUnitToggle',
5
- component: BaseUnitToggle,
6
- argTypes: {
7
- unitPair: {
8
- control: { type: 'select', options: Object.keys(unitPairs) }
9
- },
10
- valueSystem: {
11
- description: 'The system of measurement that corresponds with the provided `value`',
12
- control: { type: 'select', options: ['imperial', 'metric'] }
13
- },
14
- value: {
15
- description: 'The initial value to be converted'
16
- },
17
- secondValue: {
18
- description: 'Manually override the converted value'
19
- }
20
- }
5
+ component: BaseUnitToggle
21
6
  }
22
7
 
23
8
  const BaseUnitToggleTemplate = (args) => ({
@@ -157,18 +157,22 @@ export default defineComponent({
157
157
  required: true,
158
158
  validator: (val: UnitName): boolean => Boolean(unitPairs[val])
159
159
  },
160
+ /** The initial value to be converted */
160
161
  value: {
161
162
  type: Number as PropType<number>,
162
163
  required: true
163
164
  },
165
+ /** Manually override the converted value */
164
166
  secondValue: {
165
167
  type: Number as PropType<number>,
166
168
  required: false
167
169
  },
170
+ /** The system of measurement that corresponds with the provided `value` */
168
171
  valueSystem: {
169
172
  type: String as PropType<UnitSystemName>,
170
173
  required: true
171
174
  },
175
+ /** If value and unit should appear on the same line */
172
176
  inline: {
173
177
  type: Boolean,
174
178
  default: false
@@ -41,7 +41,8 @@
41
41
  </div>
42
42
  </template>
43
43
  <script lang="ts">
44
- import { defineComponent } from 'vue'
44
+ import { defineComponent, type PropType } from 'vue'
45
+ import type { VideoObject } from './../../interfaces'
45
46
  import BaseImagePlaceholder from './../BaseImagePlaceholder/BaseImagePlaceholder.vue'
46
47
 
47
48
  export default defineComponent({
@@ -50,10 +51,13 @@ export default defineComponent({
50
51
  BaseImagePlaceholder
51
52
  },
52
53
  props: {
54
+ /** Video data object */
53
55
  data: {
54
- type: Object,
55
- required: false
56
+ type: Object as PropType<VideoObject>,
57
+ required: false,
58
+ default: undefined
56
59
  },
60
+ /** If video should autoplay */
57
61
  autoplay: {
58
62
  type: Boolean,
59
63
  default: false
@@ -4,7 +4,7 @@ import { BlockImageData } from './../BlockImage/BlockImage.stories'
4
4
  export default {
5
5
  title: 'Components/Blocks/BlockAccordion',
6
6
  component: BlockAccordion,
7
- tags: ['!autodocs'],
7
+ tags: ['wagtail-blocks'],
8
8
  excludeStories: /.*Data$/
9
9
  }
10
10
 
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, reactive } from 'vue'
3
- import type { AccordionItemObject, ImageBlock, ImageObject } from '../../interfaces'
3
+ import type { AccordionItemObject, ImageBlock, ImageObject, HeadingLevels } from '../../interfaces'
4
4
  import BaseAccordionItem from './../BaseAccordionItem/BaseAccordionItem.vue'
5
5
  import BlockImageStandard from './../BlockImage/BlockImageStandard.vue'
6
6
  import BlockText from './../BlockText/BlockText.vue'
@@ -37,8 +37,8 @@ const props = withDefaults(defineProps<BlockAccordionProps>(), {
37
37
 
38
38
  const { data } = reactive(props)
39
39
 
40
- const headingLevel = computed(() => {
41
- return data ? `h${data?.accordionItemsHeadingLevel}` : undefined
40
+ const headingLevel = computed((): HeadingLevels | undefined => {
41
+ return data ? (`h${data?.accordionItemsHeadingLevel}` as HeadingLevels) : undefined
42
42
  })
43
43
 
44
44
  const remappedAccordionItems = computed((): AccordionItemObject[] | undefined => {
@@ -3,6 +3,7 @@ import BlockAudio from './BlockAudio.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockAudio',
5
5
  component: BlockAudio,
6
+ tags: ['wagtail-blocks'],
6
7
  excludeStories: /.*Data$/
7
8
  }
8
9
 
@@ -41,12 +41,19 @@
41
41
  </div>
42
42
  </template>
43
43
  <script lang="ts">
44
- import { defineComponent } from 'vue'
44
+ import { defineComponent, type PropType } from 'vue'
45
+ import type { BlockData, ImageObject } from './../../interfaces.ts'
45
46
  import BaseImagePlaceholder from './../BaseImagePlaceholder/BaseImagePlaceholder.vue'
46
47
  import BaseImage from './../BaseImage/BaseImage.vue'
47
48
  import BaseAudio from './../BaseAudio/BaseAudio.vue'
48
49
  import LayoutHelper from './../LayoutHelper/LayoutHelper.vue'
49
50
 
51
+ export interface BlockAudioData extends BlockData {
52
+ thumbnailImage: ImageObject
53
+ uploadedMedia: {
54
+ file: string
55
+ }
56
+ }
50
57
  export default defineComponent({
51
58
  name: 'BlockAudio',
52
59
  components: {
@@ -57,8 +64,9 @@ export default defineComponent({
57
64
  },
58
65
  props: {
59
66
  data: {
60
- type: Object,
61
- required: false
67
+ type: Object as PropType<BlockAudioData>,
68
+ required: false,
69
+ default: undefined
62
70
  }
63
71
  }
64
72
  })
@@ -3,7 +3,7 @@ import BlockCardGrid from './BlockCardGrid.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockCardGrid',
5
5
  component: BlockCardGrid,
6
- tags: ['!autodocs'],
6
+ tags: ['!autodocs', 'wagtail-blocks', 'listings'],
7
7
  excludeStories: /.*Data$/
8
8
  }
9
9
 
@@ -41,7 +41,7 @@ import type { ImageObject, LinkObject } from '../../interfaces'
41
41
  import BlockCardGridItem from './../BlockCardGridItem/BlockCardGridItem.vue'
42
42
  import MixinCarousel from './../MixinCarousel/MixinCarousel.vue'
43
43
 
44
- interface CardGridItem {
44
+ export interface CardGridItem {
45
45
  title: string
46
46
  label: string
47
47
  description: string
@@ -3,7 +3,7 @@ import BlockCardGridItem from './BlockCardGridItem.vue'
3
3
  export default {
4
4
  title: 'Components/Cards/BlockCardGridItem',
5
5
  component: BlockCardGridItem,
6
- tags: ['!autodocs'],
6
+ tags: ['!autodocs', 'cards'],
7
7
  decorators: [
8
8
  () => ({
9
9
  template: `<div id="storyRoot" class="lg:w-1/3"><story/></div>`
@@ -4,19 +4,12 @@ import BlockCircleImageCard from './BlockCircleImageCard.vue'
4
4
  export default {
5
5
  title: 'Components/Cards/BlockCircleImageCard',
6
6
  component: BlockCircleImageCard,
7
- tags: ['!autodocs'],
7
+ tags: ['!autodocs', 'cards'],
8
8
  decorators: [
9
9
  () => ({
10
10
  template: `<div id="storyRoot" class="relative max-w-xl mx-auto container"><story/></div>`
11
11
  })
12
12
  ],
13
- argTypes: {
14
- imageOnRight: {
15
- control: {
16
- type: 'boolean'
17
- }
18
- }
19
- },
20
13
  parameters: {
21
14
  html: { root: '#storyRoot' },
22
15
  slots: {
@@ -3,6 +3,7 @@ import BlockCsrTable from './BlockCsrTable.vue'
3
3
  export default {
4
4
  title: 'Components/FeatureFlags/BlockCsrTable',
5
5
  component: BlockCsrTable,
6
+ tags: ['!autodocs', 'wagtail-blocks', 'feature-flag'],
6
7
  excludeStories: /.*Data$/
7
8
  }
8
9
 
@@ -34,7 +34,7 @@ export interface ExportPackageRate {
34
34
  Fluence: string
35
35
  Energy: string
36
36
  }
37
- interface BlockCsrTableRow {
37
+ export interface BlockCsrTableRow {
38
38
  Id: number
39
39
  TestRecordId: number
40
40
  Attachment: string
@@ -3,6 +3,7 @@ import BlockCta from './BlockCta.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockCta',
5
5
  component: BlockCta,
6
+ tags: ['!autodocs', 'wagtail-blocks'],
6
7
  excludeStories: /.*Data$/
7
8
  }
8
9
 
@@ -26,12 +26,19 @@
26
26
  </div>
27
27
  </template>
28
28
  <script lang="ts">
29
- import { defineComponent } from 'vue'
29
+ import { defineComponent, type PropType } from 'vue'
30
30
  import { mapStores } from 'pinia'
31
+ import type { BlockData, PageObject } from './../../interfaces.ts'
31
32
  import { useThemeStore } from '../../store/theme'
32
33
  import BaseButton from './../BaseButton/BaseButton.vue'
33
34
  import IconExternal from './../Icons/IconExternal.vue'
34
35
 
36
+ export type BlockCtaData = BlockData & {
37
+ page: PageObject
38
+ text: string
39
+ externalLink: string
40
+ }
41
+
35
42
  export default defineComponent({
36
43
  name: 'BlockCta',
37
44
  components: {
@@ -40,7 +47,7 @@ export default defineComponent({
40
47
  },
41
48
  props: {
42
49
  data: {
43
- type: Object,
50
+ type: Object as PropType<BlockCtaData>,
44
51
  required: true,
45
52
  default: () => ({})
46
53
  }
@@ -1,8 +1,9 @@
1
1
  import BlockDialog from './BlockDialog.vue'
2
2
 
3
3
  export default {
4
- title: 'Components/Blocks/BlockDialog',
4
+ title: 'Components/Utilities/BlockDialog',
5
5
  component: BlockDialog,
6
+ tags: ['!autodocs', 'deprecated'],
6
7
  argTypes: {
7
8
  overlayClose: { control: { type: 'boolean' } }
8
9
  }
@@ -3,10 +3,11 @@ import BlockGist from './BlockGist.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockGist',
5
5
  component: BlockGist,
6
+ tags: ['wagtail-blocks'],
6
7
  excludeStories: /.*Data$/
7
8
  }
8
9
 
9
- export const BlockGistData = {
10
+ export const BlockGistStoryData = {
10
11
  blockType: 'GitHubGistBlock',
11
12
  caption: '<p>Caption for gist block</p>',
12
13
  id: 'cefc8e20-2833-4d0b-a4d6-7f469d5dbd02',
@@ -17,6 +18,6 @@ export const BlockGistData = {
17
18
  export const BaseStory = {
18
19
  name: 'BlockGist',
19
20
  args: {
20
- data: BlockGistData
21
+ data: BlockGistStoryData
21
22
  }
22
23
  }
@@ -1,14 +1,16 @@
1
1
  <script setup lang="ts">
2
2
  import { ref, watch } from 'vue'
3
+ import type { BlockData } from './../../interfaces.ts'
3
4
  import BaseImageCaption from './../BaseImageCaption/BaseImageCaption.vue'
4
5
  import GitHub404 from './GitHub404.vue'
6
+
7
+ export interface BlockGistData extends BlockData {
8
+ caption?: string
9
+ id?: string
10
+ url?: string
11
+ }
5
12
  interface BlockGistProps {
6
- data: {
7
- blockType?: string
8
- caption?: string
9
- id?: string
10
- url?: string
11
- }
13
+ data: BlockGistData
12
14
  }
13
15
 
14
16
  const props = defineProps<BlockGistProps>()
@@ -2,6 +2,7 @@ import BlockHeading from './BlockHeading.vue'
2
2
  export default {
3
3
  title: 'Components/Blocks/BlockHeading',
4
4
  component: BlockHeading,
5
+ tags: ['wagtail-blocks'],
5
6
  excludeStories: /.*Data$/
6
7
  }
7
8
 
@@ -3,6 +3,7 @@ import BlockIframeEmbed from './BlockIframeEmbed.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockIframeEmbed',
5
5
  component: BlockIframeEmbed,
6
+ tags: ['wagtail-blocks'],
6
7
  decorators: [
7
8
  () => ({
8
9
  template: `<div id="storyRoot" class="mx-auto max-w-screen-md"><story/></div>`
@@ -47,18 +47,25 @@
47
47
  </div>
48
48
  </template>
49
49
  <script lang="ts">
50
- import { defineComponent } from 'vue'
50
+ import { defineComponent, type PropType } from 'vue'
51
51
  import { mapStores } from 'pinia'
52
+ import type { BlockData } from './../../interfaces.ts'
52
53
  import { useThemeStore } from '../../store/theme'
53
54
  import BaseImageCaption from './../BaseImageCaption/BaseImageCaption.vue'
54
55
  import BaseImagePlaceholder from './../BaseImagePlaceholder/BaseImagePlaceholder.vue'
55
56
 
57
+ export type BlockIframeEmbedData = BlockData & {
58
+ caption: string
59
+ title: string
60
+ url: string
61
+ height?: number
62
+ }
56
63
  export default defineComponent({
57
64
  name: 'BlockIframeEmbed',
58
65
  components: { BaseImageCaption, BaseImagePlaceholder },
59
66
  props: {
60
67
  data: {
61
- type: Object,
68
+ type: Object as PropType<BlockIframeEmbedData>,
62
69
  default: undefined
63
70
  }
64
71
  },
@@ -3,11 +3,7 @@ import BlockImage from './BlockImage.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockImage',
5
5
  component: BlockImage,
6
- argTypes: {
7
- fullBleed: {
8
- control: { type: 'boolean' }
9
- }
10
- },
6
+ tags: ['autodocs', 'wagtail-blocks'],
11
7
  excludeStories: /.*Data$/,
12
8
  parameters: {
13
9
  docs: {
@@ -1,5 +1,7 @@
1
1
  <script lang="ts">
2
- import { defineComponent } from 'vue'
2
+ /** The combination of BaseImage and BaseImageCaption, plus adding support for expanding the image in a lightbox and styling it to be a full-bleed image. */
3
+ import { defineComponent, type PropType } from 'vue'
4
+ import type { ImageBlock } from './../../interfaces'
3
5
  import BlockImageStandard from './BlockImageStandard.vue'
4
6
  import BlockImageFullBleed from './BlockImageFullBleed.vue'
5
7
  import LayoutHelper from './../LayoutHelper/LayoutHelper.vue'
@@ -13,9 +15,10 @@ export default defineComponent({
13
15
  },
14
16
  props: {
15
17
  data: {
16
- type: Object,
18
+ type: Object as PropType<ImageBlock>,
17
19
  required: false
18
20
  },
21
+ /** If image should be the full width of the container */
19
22
  fullBleed: {
20
23
  type: Boolean,
21
24
  required: false,
@@ -3,24 +3,12 @@ import BlockImageCarousel from './BlockImageCarousel.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockImageCarousel',
5
5
  component: BlockImageCarousel,
6
+ tags: ['autodocs', 'wagtail-blocks', 'carousels'],
6
7
  decorators: [
7
8
  () => ({
8
9
  template: `<div id="storyRoot" class="container"><story/></div>`
9
10
  })
10
11
  ],
11
- argTypes: {
12
- blockId: {
13
- text: { type: 'string' },
14
- required: false,
15
- description:
16
- 'Fancybox: the block id is used to differentiate the fancybox of this carousel from others on the page. Generated by Wagtail.'
17
- },
18
- showTitle: {
19
- text: { type: 'string' },
20
- required: false,
21
- description: "Fancybox: if image titles should be displayed in the carousel's fancybox"
22
- }
23
- },
24
12
  parameters: {
25
13
  html: {
26
14
  root: '#storyRoot'
@@ -101,10 +101,12 @@ export default defineComponent({
101
101
  type: Number,
102
102
  required: false
103
103
  },
104
+ /** Fancybox: the block id is used to differentiate the fancybox of this carousel from others on the page. Generated by Wagtail. */
104
105
  blockId: {
105
106
  type: String,
106
107
  required: false
107
108
  },
109
+ /** Fancybox: if image titles should be displayed in the carousel's fancybox */
108
110
  showTitle: {
109
111
  type: Boolean,
110
112
  required: false,
@@ -8,20 +8,6 @@ export default {
8
8
  template: `<div id="storyRoot" class="container mx-auto"><story/></div>`
9
9
  })
10
10
  ],
11
- argTypes: {
12
- blockId: {
13
- text: { type: 'string' },
14
- required: false,
15
- description:
16
- 'Fancybox: the block id is used to differentiate the fancybox of the items in a carousel from other carousels on the page. Generated by Wagtail. Usually provided by parent component `BlockImageCarousel`.'
17
- },
18
- showTitle: {
19
- text: { type: 'string' },
20
- required: false,
21
- description:
22
- "Fancybox: if the image title should be displayed in the item's fancybox. Usually provided by parent component `BlockImageCarousel`."
23
- }
24
- },
25
11
  parameters: {
26
12
  html: {
27
13
  root: '#storyRoot'
@@ -41,7 +41,7 @@
41
41
  </div>
42
42
  </template>
43
43
  <script lang="ts">
44
- import { defineComponent } from 'vue'
44
+ import { defineComponent, type PropType } from 'vue'
45
45
  import type { ImageObject } from '../../interfaces'
46
46
  import MixinFancybox from './../MixinFancybox/MixinFancybox.vue'
47
47
  import BaseImage from './../BaseImage/BaseImage.vue'
@@ -58,26 +58,26 @@ export default defineComponent({
58
58
  },
59
59
  props: {
60
60
  image: {
61
- type: Object,
61
+ type: Object as PropType<ImageObject>,
62
62
  required: true,
63
63
  default: () => ({})
64
64
  },
65
- // if a caption should even be visible
65
+ /** If caption should be visible */
66
66
  displayCaption: {
67
67
  type: Boolean,
68
68
  default: true
69
69
  },
70
- // overrides caption provided with image model
70
+ /** Overrides caption provided by `{ImageObject}` */
71
71
  caption: {
72
72
  type: String,
73
73
  required: false
74
74
  },
75
- // used to differentiate the fancybox of this carousel from others on the page; generated by Wagtail
75
+ /** 'Fancybox: the block id is used to differentiate the fancybox of the items in a carousel from other carousels on the page. Generated by Wagtail. Usually provided by parent component `BlockImageCarousel`.' */
76
76
  blockId: {
77
77
  type: String,
78
78
  required: false
79
79
  },
80
- // if image titles should be displayed in the carousel's fancybox
80
+ /** Fancybox: if the image title should be displayed in the item's fancybox. Usually provided by parent component `BlockImageCarousel`. */
81
81
  showTitle: {
82
82
  type: Boolean,
83
83
  required: false,
@@ -108,7 +108,7 @@ export default defineComponent({
108
108
  }
109
109
  return null
110
110
  },
111
- hasCaptionArea(): string | boolean {
111
+ hasCaptionArea(): string | boolean | undefined {
112
112
  if (this.image) {
113
113
  return this.theCaption || this.image.credit || this.image.detailUrl
114
114
  }
@@ -3,6 +3,7 @@ import BlockImageComparison from './BlockImageComparison.vue'
3
3
  export default {
4
4
  title: 'Components/Blocks/BlockImageComparison',
5
5
  component: BlockImageComparison,
6
+ tags: ['wagtail-blocks'],
6
7
  decorators: [
7
8
  () => ({
8
9
  template: `<div id="storyRoot" class="container mx-auto"><story/></div>`
@@ -41,6 +42,7 @@ export const BlockImageComparisonData = {
41
42
  export const BaseStory = {
42
43
  name: 'BlockImageComparison',
43
44
  args: {
44
- data: BlockImageComparisonData
45
+ data: BlockImageComparisonData,
46
+ customDetailUrl: 'https://www.google.com'
45
47
  }
46
48
  }