@explorer-1/vue 0.3.4 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/package.json +2 -2
  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 +2 -7
  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 +24 -4
  10. package/src/components/BaseAccordionItem/BaseAccordionItem.vue +56 -17
  11. package/src/components/BaseAudio/BaseAudio.stories.js +4 -6
  12. package/src/components/BaseAudio/BaseAudio.vue +6 -0
  13. package/src/components/BaseButton/BaseButton.stories.ts +12 -23
  14. package/src/components/BaseButton/BaseButton.vue +34 -10
  15. package/src/components/BaseCheckboxGroup/BaseCheckboxGroup.stories.js +2 -1
  16. package/src/components/BaseCheckboxGroup/BaseCheckboxGroup.vue +5 -0
  17. package/src/components/BaseHeading/BaseHeading.stories.js +9 -17
  18. package/src/components/BaseHeading/BaseHeading.vue +18 -8
  19. package/src/components/BaseImage/BaseImage.stories.ts +7 -17
  20. package/src/components/BaseImage/BaseImage.vue +26 -14
  21. package/src/components/BaseImageCaption/BaseImageCaption.stories.js +11 -0
  22. package/src/components/BaseImageCaption/BaseImageCaption.vue +10 -6
  23. package/src/components/BaseImagePlaceholder/BaseImagePlaceholder.stories.js +13 -15
  24. package/src/components/BaseImagePlaceholder/BaseImagePlaceholder.vue +13 -9
  25. package/src/components/BaseLink/BaseLink.stories.js +8 -7
  26. package/src/components/BaseLink/BaseLink.vue +32 -21
  27. package/src/components/BaseModal/BaseModal.stories.js +4 -7
  28. package/src/components/BaseModal/BaseModal.vue +1 -0
  29. package/src/components/BaseModal/BaseModalDialog.vue +1 -6
  30. package/src/components/BasePill/BasePill.stories.js +8 -22
  31. package/src/components/BasePill/BasePill.vue +36 -19
  32. package/src/components/BasePlaceholder/BasePlaceholder.stories.js +4 -7
  33. package/src/components/BasePlaceholder/BasePlaceholder.vue +1 -1
  34. package/src/components/BaseRadioGroup/BaseRadioGroup.stories.js +1 -0
  35. package/src/components/BaseRadioGroup/BaseRadioGroup.vue +9 -2
  36. package/src/components/BaseSwimlane/BaseSwimlane.stories.js +2 -1
  37. package/src/components/BaseSwimlane/BaseSwimlane.vue +2 -0
  38. package/src/components/BaseTimer/BaseTimer.stories.js +7 -2
  39. package/src/components/BaseTimer/BaseTimer.vue +4 -2
  40. package/src/components/BaseUnitToggle/BaseUnitToggle.stories.js +1 -16
  41. package/src/components/BaseUnitToggle/BaseUnitToggle.vue +4 -0
  42. package/src/components/BaseVideo/BaseVideo.vue +7 -3
  43. package/src/components/BlockAccordion/BlockAccordion.stories.js +4 -2
  44. package/src/components/BlockAccordion/BlockAccordion.vue +3 -3
  45. package/src/components/BlockAudio/BlockAudio.stories.js +1 -0
  46. package/src/components/BlockAudio/BlockAudio.vue +11 -3
  47. package/src/components/BlockCardGrid/BlockCardGrid.stories.js +1 -1
  48. package/src/components/BlockCardGrid/BlockCardGrid.vue +1 -1
  49. package/src/components/BlockCardGridItem/BlockCardGridItem.stories.js +3 -3
  50. package/src/components/BlockCardGridItem/BlockCardGridItemElement.vue +1 -1
  51. package/src/components/BlockCircleImageCard/BlockCircleImageCard.stories.js +3 -9
  52. package/src/components/BlockCsrTable/BlockCsrTable.stories.js +1 -0
  53. package/src/components/BlockCsrTable/BlockCsrTable.vue +1 -1
  54. package/src/components/BlockCta/BlockCta.stories.js +1 -0
  55. package/src/components/BlockCta/BlockCta.vue +9 -2
  56. package/src/components/BlockDialog/BlockDialog.stories.js +2 -1
  57. package/src/components/BlockGist/BlockGist.stories.js +3 -2
  58. package/src/components/BlockGist/BlockGist.vue +8 -6
  59. package/src/components/BlockHeading/BlockHeading.stories.js +1 -0
  60. package/src/components/BlockIframeEmbed/BlockIframeEmbed.stories.js +3 -2
  61. package/src/components/BlockIframeEmbed/BlockIframeEmbed.vue +9 -2
  62. package/src/components/BlockImage/BlockImage.stories.js +1 -5
  63. package/src/components/BlockImage/BlockImage.vue +5 -2
  64. package/src/components/BlockImageCarousel/BlockImageCarousel.stories.js +3 -15
  65. package/src/components/BlockImageCarousel/BlockImageCarousel.vue +2 -0
  66. package/src/components/BlockImageCarouselItem/BlockImageCarouselItem.stories.js +2 -16
  67. package/src/components/BlockImageCarouselItem/BlockImageCarouselItem.vue +7 -7
  68. package/src/components/BlockImageComparison/BlockImageComparison.stories.js +5 -3
  69. package/src/components/BlockImageComparison/BlockImageComparison.vue +11 -2
  70. package/src/components/BlockImageGallery/BlockImageGallery.stories.js +4 -11
  71. package/src/components/BlockImageGallery/BlockImageGallery.vue +5 -0
  72. package/src/components/BlockInlineImage/BlockInlineImage.stories.js +5 -2
  73. package/src/components/BlockInlineImage/BlockInlineImage.vue +20 -7
  74. package/src/components/BlockKeyPoints/BlockKeyPoints.stories.js +1 -0
  75. package/src/components/BlockKeyPoints/BlockKeyPoints.vue +12 -3
  76. package/src/components/BlockLinkCard/BlockLinkCard.stories.js +24 -34
  77. package/src/components/BlockLinkCard/BlockLinkCard.vue +28 -9
  78. package/src/components/BlockLinkCard/BlockLinkCardCollectionLg.vue +2 -2
  79. package/src/components/BlockLinkCardList/BlockLinkCardList.stories.js +1 -3
  80. package/src/components/BlockLinkCarousel/BlockLinkCarousel.stories.js +2 -14
  81. package/src/components/BlockLinkCarousel/BlockLinkCarousel.vue +8 -8
  82. package/src/components/BlockLinkTile/BlockLinkTile.stories.js +3 -13
  83. package/src/components/BlockLinkTile/BlockLinkTile.vue +26 -13
  84. package/src/components/BlockListCards/BlockListCards.stories.js +1 -0
  85. package/src/components/BlockListCards/BlockListCards.vue +5 -4
  86. package/src/components/BlockNewsletterSignup/BlockNewsletterSignup.stories.js +1 -0
  87. package/src/components/BlockNewsletterSignup/BlockNewsletterSignup.vue +3 -2
  88. package/src/components/BlockQuote/BlockQuote.stories.js +1 -0
  89. package/src/components/BlockQuote/BlockQuote.vue +3 -2
  90. package/src/components/BlockRelatedLinks/BlockRelatedLinks.stories.js +1 -0
  91. package/src/components/BlockRelatedLinks/BlockRelatedLinks.vue +6 -4
  92. package/src/components/BlockRichTable/BlockRichTable.stories.js +1 -1
  93. package/src/components/BlockRichTable/BlockRichTable.vue +23 -9
  94. package/src/components/BlockStreamfield/BlockStreamfield.stories.js +1 -11
  95. package/src/components/BlockStreamfield/BlockStreamfield.vue +34 -31
  96. package/src/components/BlockTeaser/BlockTeaser.stories.js +1 -0
  97. package/src/components/BlockTeaser/BlockTeaser.vue +20 -12
  98. package/src/components/BlockText/BlockText.stories.js +2 -9
  99. package/src/components/BlockText/BlockText.vue +21 -9
  100. package/src/components/BlockVideo/BlockVideo.stories.js +1 -0
  101. package/src/components/BlockVideo/BlockVideo.vue +14 -3
  102. package/src/components/BlockVideoEmbed/BlockVideoEmbed.stories.js +1 -0
  103. package/src/components/BlockVideoEmbed/BlockVideoEmbed.vue +6 -3
  104. package/src/components/CalendarButton/CalendarButton.vue +7 -0
  105. package/src/components/DetailHeadline/DetailHeadline.stories.js +2 -20
  106. package/src/components/DetailHeadline/DetailHeadline.vue +16 -4
  107. package/src/components/DsnWidget/DsnWidget.stories.js +2 -6
  108. package/src/components/DsnWidget/DsnWidget.vue +18 -4
  109. package/src/components/EventDetailHero/EventDetailHero.stories.js +10 -7
  110. package/src/components/EventDetailHero/EventDetailHero.vue +4 -7
  111. package/src/components/FormContact/FormContact.stories.js +2 -1
  112. package/src/components/FormNewsletterSignup/FormNewsletterSignup.stories.js +2 -1
  113. package/src/components/HeroInlineMedia/HeroInlineMedia.vue +12 -8
  114. package/src/components/HeroLarge/HeroLarge.stories.js +27 -2
  115. package/src/components/HeroLarge/HeroLarge.vue +12 -5
  116. package/src/components/HeroListingIndex/HeroListingIndex.stories.js +1 -0
  117. package/src/components/HeroListingIndex/HeroListingIndex.vue +18 -13
  118. package/src/components/HeroMedia/HeroMedia.stories.js +14 -9
  119. package/src/components/HeroMedia/HeroMedia.vue +9 -8
  120. package/src/components/HeroMedium/HeroMedium.stories.js +19 -4
  121. package/src/components/HeroMedium/HeroMedium.vue +32 -14
  122. package/src/components/HeroMedium/HeroSmall.stories.js +20 -6
  123. package/src/components/HomepageCarousel/HomepageCarousel.stories.js +1 -1
  124. package/src/components/HomepageCarouselItem/HomepageCarouselItem.stories.js +2 -2
  125. package/src/components/HomepageCarouselItem/HomepageCarouselItem.vue +2 -6
  126. package/src/components/HomepageEmbedBlock/HomepageEmbedBlock.vue +2 -2
  127. package/src/components/LogoCaltech/LogoCaltech.stories.js +14 -18
  128. package/src/components/LogoCaltech/LogoCaltech.vue +1 -0
  129. package/src/components/LogoTribrand/LogoTribrand.stories.js +66 -51
  130. package/src/components/LogoTribrand/LogoTribrand.vue +4 -2
  131. package/src/components/MetaPanel/MetaPanel.stories.js +5 -9
  132. package/src/components/MetaPanel/MetaPanel.vue +3 -0
  133. package/src/components/MetaPanelItems/MetaPanelItems.stories.js +9 -2
  134. package/src/components/MetaPanelItems/MetaPanelItems.vue +2 -0
  135. package/src/components/MetadataEduResource/MetadataEduResource.stories.js +12 -10
  136. package/src/components/MetadataEduResource/MetadataEduResource.vue +7 -3
  137. package/src/components/MetadataEvent/MetadataEvent.stories.js +1 -1
  138. package/src/components/MissionDetailAbout/MissionDetailAbout.vue +1 -1
  139. package/src/components/MissionDetailHero/MissionDetailHero.stories.js +2 -2
  140. package/src/components/MissionDetailHighlights/MissionDetailHighlights.stories.js +1 -0
  141. package/src/components/MissionDetailInlineImage/MissionDetailInlineImage.stories.js +1 -6
  142. package/src/components/MissionDetailInlineImage/MissionDetailInlineImage.vue +10 -5
  143. package/src/components/MissionDetailStats/DistanceStats.vue +10 -5
  144. package/src/components/MissionDetailStats/MissionDetailStats.stories.js +4 -21
  145. package/src/components/MissionDetailStats/MissionDetailStats.vue +21 -5
  146. package/src/components/MissionDetailStreamfield/MissionDetailStreamfield.vue +4 -2
  147. package/src/components/MixinAnimationCaret/MixinAnimationCaret.stories.ts +7 -0
  148. package/src/components/MixinAnimationCaret/MixinAnimationCaret.vue +12 -6
  149. package/src/components/MixinCarousel/MixinCarousel.stories.js +2 -8
  150. package/src/components/MixinCarousel/MixinCarousel.vue +13 -16
  151. package/src/components/MixinVideoBg/MixinVideoBg.stories.js +1 -1
  152. package/src/components/MixinVideoBg/MixinVideoBg.vue +4 -7
  153. package/src/components/NavDesktop/NavDesktop.stories.js +1 -0
  154. package/src/components/NavDesktop/NavDesktop.vue +4 -4
  155. package/src/components/NavDesktop/NavDesktopTopHat.vue +4 -4
  156. package/src/components/NavDesktopEdu/NavDesktopEdu.stories.js +1 -5
  157. package/src/components/NavDesktopEdu/NavDesktopEdu.vue +4 -4
  158. package/src/components/NavHeading/NavHeading.stories.js +3 -2
  159. package/src/components/NavHighlight/NavHighlight.stories.js +3 -2
  160. package/src/components/NavJumpMenu/NavJumpMenu.stories.js +5 -2
  161. package/src/components/NavLinkList/NavLinkList.stories.js +3 -2
  162. package/src/components/NavLinkList/NavLinkList.vue +3 -3
  163. package/src/components/NavLogoLinks/NavLogoLinks.stories.js +1 -0
  164. package/src/components/NavMobile/NavMobile.stories.js +13 -2
  165. package/src/components/NavMobile/NavMobile.vue +18 -5
  166. package/src/components/NavMobile/NavMobileDropdown.vue +2 -2
  167. package/src/components/NavMobile/NavMobileEdu.stories.js +11 -4
  168. package/src/components/NavMobile/NavMobileLink.vue +4 -4
  169. package/src/components/NavSearchForm/NavSearchForm.stories.js +1 -0
  170. package/src/components/NavSecondary/NavSecondary.stories.js +1 -0
  171. package/src/components/NavSecondary/NavSecondary.vue +7 -4
  172. package/src/components/NavSecondary/NavSecondaryDropdownContent.vue +1 -1
  173. package/src/components/NavSocial/NavSocial.stories.js +1 -0
  174. package/src/components/NewsDetailMediaContact/NewsDetailMediaContact.stories.js +2 -1
  175. package/src/components/NewsDetailMediaContact/NewsDetailMediaContact.vue +1 -1
  176. package/src/components/ParallaxContainer/ParallaxContainer.stories.js +2 -2
  177. package/src/components/ParallaxContainer/ParallaxContainer.vue +1 -0
  178. package/src/components/PodcastSeriesCarousel/PodcastSeriesCarousel.vue +6 -5
  179. package/src/components/RoboticsDetailStats/RoboticsDetailStats.stories.js +3 -8
  180. package/src/components/SearchFilterGroup/SearchFilterGroup.stories.js +1 -0
  181. package/src/components/SearchInput/SearchInput.stories.js +1 -0
  182. package/src/components/SearchPagination/SearchPagination.stories.js +1 -0
  183. package/src/components/SearchResultCard/SearchResultCard.stories.js +1 -10
  184. package/src/components/SearchResultCard/SearchResultCard.vue +1 -0
  185. package/src/components/SearchResultGridItem/SearchResultGridItem.stories.js +3 -12
  186. package/src/components/SearchResultGridItem/SearchResultGridItem.vue +5 -2
  187. package/src/components/SearchResultsList/SearchResultsList.stories.js +3 -3
  188. package/src/components/SearchSelectMenu/SearchSelectMenu.stories.js +2 -1
  189. package/src/components/SwimlaneCTA/SwimlaneCTA.vue +1 -0
  190. package/src/components/TextArea/TextArea.stories.js +2 -1
  191. package/src/components/TextInput/TextInput.stories.js +2 -1
  192. package/src/components/TheFooter/TheFooter.stories.js +1 -0
  193. package/src/components/TheFooter/TheFooter.vue +30 -4
  194. package/src/components/ThumbnailCarousel/ThumbnailCarousel.stories.js +1 -1
  195. package/src/components/ThumbnailCarousel/ThumbnailCarousel.vue +2 -1
  196. package/src/components/TimelineDialog/TimelineDialog.vue +2 -2
  197. package/src/components/TopicDetailMissionCarousel/TopicDetailMissionCarousel.stories.js +1 -0
  198. package/src/components/TopicDetailMissionCarouselItem/TopicDetailMissionCarouselItem.stories.js +2 -2
  199. package/src/components/TopicDetailMore/TopicDetailMore.stories.js +1 -0
  200. package/src/components/TopicDetailMoreItem/TopicDetailMoreItem.stories.js +3 -2
  201. package/src/components/TopicDetailStreamfield/TopicDetailStreamfield.vue +2 -2
  202. package/src/constants.ts +3 -5
  203. package/src/docs/foundation/grid_layouthelpers.stories.js +2 -2
  204. package/src/docs/introduction.docs.mdx +14 -2
  205. package/src/interfaces.ts +31 -6
  206. package/src/templates/PageAudioDetail/PageAudioDetail.vue +2 -2
  207. package/src/templates/PageContent/PageContent.stories.js +1 -1
  208. package/src/templates/PageEventDetail/PageEventDetail.stories.js +1 -1
  209. package/src/templates/PageNewsDetail/PageNewsDetail.stories.js +2 -2
  210. package/src/templates/edu/PageContentEdu.stories.js +2 -2
  211. package/src/templates/edu/PageEduCollectionsDetail/PageEduCollectionsDetail.stories.js +2 -2
  212. package/src/templates/edu/PageEduEventDetail/PageEduEventDetail.stories.js +1 -1
  213. package/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.stories.js +2 -2
  214. package/src/templates/edu/PageEduGalleryDetail/PageEduGalleryDetail.stories.js +1 -1
  215. package/src/templates/edu/PageEduGalleryDetail/PageEduGalleryDetail.vue +10 -6
  216. package/src/templates/edu/PageEduHome/PageEduHome.stories.js +1 -1
  217. package/src/templates/edu/PageEduLesson/PageEduLesson.stories.js +2 -2
  218. package/src/templates/edu/PageEduMultimediaDetail/PageEduMultimediaDetail.stories.js +1 -1
  219. package/src/templates/edu/PageEduNewsDetail/PageEduNewsDetail.stories.js +2 -2
  220. package/src/templates/edu/PageEduStudentProject/PageEduStudentProject.stories.js +2 -2
  221. package/src/templates/edu/PageEduStudentProject/PageEduStudentProjectSection.vue +10 -6
  222. package/src/templates/edu/PageEduTeachableMoment/PageEduTeachableMoment.stories.js +2 -2
  223. package/src/templates/www/PageAsteroidWatchContent/PageAsteroidWatchContent.stories.js +2 -2
  224. package/src/templates/www/PageAsteroidWatchIndex/PageAsteroidWatchIndex.stories.js +2 -2
  225. package/src/templates/www/PageGoDirectory/PageGoDirectory.stories.js +2 -2
  226. package/src/templates/www/PageHomepage/PageHomepage.stories.js +2 -2
  227. package/src/templates/www/PageMissionDetail/PageMissionDetail.stories.js +2 -2
  228. package/src/templates/www/PagePodcast/PagePodcast.stories.js +2 -2
  229. package/src/templates/www/PagePodcastSeason/PagePodcastSeason.stories.js +2 -2
  230. package/src/templates/www/PagePressKitIndex/PagePressKitIndex.stories.js +2 -2
  231. package/src/templates/www/PageProfileDetail/PageProfileDetail.stories.js +2 -2
  232. package/src/templates/www/PageRoboticsDetail/PageRoboticsDetail.stories.js +2 -2
  233. package/src/templates/www/PageTimeline/PageTimeline.stories.js +2 -2
  234. package/src/templates/www/PageTopicDetail/PageTopicDetail.stories.js +2 -2
  235. package/src/templates/www/PageTopicDetail/PageTopicDetail.vue +2 -1
  236. package/src/utils/mixins.ts +7 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @explorer-1/vue
2
2
 
3
+ ## 0.3.7
4
+
5
+ ### Patch Changes
6
+
7
+ - bc9dbbb: Documentation updates, Storybook improvements.
8
+
9
+ ## 0.3.6
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [c307f7b]
14
+ - @explorer-1/common@1.3.3
15
+
16
+ ## 0.3.5
17
+
18
+ ### Patch Changes
19
+
20
+ - 0a83db1: Documentation updates, Storybook improvements.
21
+
3
22
  ## 0.3.4
4
23
 
5
24
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorer-1/vue",
3
- "version": "0.3.4",
3
+ "version": "0.3.7",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -31,7 +31,7 @@
31
31
  "vue-bind-once": "^0.2.1",
32
32
  "vue3-compare-image": "^1.2.5",
33
33
  "vue3-observe-visibility": "^1.0.1",
34
- "@explorer-1/common": "1.3.2"
34
+ "@explorer-1/common": "1.3.3"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@vitejs/plugin-vue": "^5.0.4",
@@ -3,7 +3,7 @@ import AboutTheAuthor from './AboutTheAuthor.vue'
3
3
  export default {
4
4
  title: 'Components/Utilities/AboutTheAuthor',
5
5
  component: AboutTheAuthor,
6
- tags: ['!autodocs'],
6
+ tags: ['listings'],
7
7
  excludeStories: /.*Data$/
8
8
  }
9
9
 
@@ -5,17 +5,17 @@ import BlockText from './../BlockText/BlockText.vue'
5
5
  import BaseImage from './../BaseImage/BaseImage.vue'
6
6
  import BaseImagePlaceholder from './../BaseImagePlaceholder/BaseImagePlaceholder.vue'
7
7
 
8
- interface AboutTheAuthorProps {
8
+ const props = defineProps({
9
+ /**
10
+ * Array of keyed `{AuthorObject}s`
11
+ */
9
12
  authors: {
10
- author?: AuthorObject
11
- }[]
12
- }
13
-
14
- // define props
15
- const props = withDefaults(defineProps<AboutTheAuthorProps>(), {
16
- authors: undefined
13
+ type: Array as () => {
14
+ author?: AuthorObject
15
+ }[],
16
+ default: () => []
17
+ }
17
18
  })
18
-
19
19
  const { authors } = reactive(props)
20
20
 
21
21
  const headingString = computed(() => {
@@ -6,17 +6,12 @@ export default {
6
6
  excludeStories: /.*Data$/,
7
7
  decorators: [
8
8
  () => ({
9
- template: `<div id="storyDecorator" class="mt-20"><story/></div>`
9
+ template: `<div id="storyRoot" class="mt-20"><story/></div>`
10
10
  })
11
11
  ],
12
12
  parameters: {
13
13
  html: {
14
- root: '#storyDecorator' // to omit decorators from html output
15
- }
16
- },
17
- argTypes: {
18
- status: {
19
- control: { type: 'text' }
14
+ root: '#storyRoot' // to omit decorators from html output
20
15
  }
21
16
  }
22
17
  }
@@ -140,9 +140,13 @@ export default defineComponent({
140
140
  BaseUnitToggle
141
141
  },
142
142
  props: {
143
+ /**
144
+ * Array of next close approaches (structure provided by backend)
145
+ */
143
146
  nextCloseApproaches: {
144
147
  type: Array as PropType<NextCloseApproach[]>,
145
- required: false
148
+ required: false,
149
+ default: undefined
146
150
  }
147
151
  }
148
152
  })
@@ -19,6 +19,6 @@ const BackToTopTemplate = (args) => ({
19
19
  export const BaseStory = BackToTopTemplate.bind({})
20
20
  BaseStory.storyName = 'BackToTop'
21
21
  BaseStory.args = {
22
- threshhold: 300,
22
+ threshold: 300,
23
23
  scrollTo: 0
24
24
  }
@@ -24,18 +24,28 @@ export default defineComponent({
24
24
  IconDropdown
25
25
  },
26
26
  props: {
27
+ /**
28
+ * Threshold (px) of when the button should appear
29
+ */
27
30
  threshold: {
28
31
  type: Number,
29
32
  required: false,
30
33
  default: 300
31
34
  },
35
+ /**
36
+ * Pixel offset when scrolling to the top
37
+ */
32
38
  scrollTo: {
33
39
  type: Number,
34
40
  required: false,
35
41
  default: 0
36
42
  }
37
43
  },
44
+ emits: ['click'],
38
45
  data(): {
46
+ /**
47
+ * Dynamically altered value that determines when the button should appear
48
+ */
39
49
  showBackToTop: Boolean
40
50
  scrollHandler: DebouncedFunc<() => void> | null
41
51
  } {
@@ -1,15 +1,35 @@
1
1
  import BaseAccordionItem from './BaseAccordionItem.vue'
2
- import { BlockStreamfieldTruncatedData } from '../BlockStreamfield/BlockStreamfield.stories'
3
2
  export default {
4
3
  title: 'Components/Base/BaseAccordionItem',
5
- component: BaseAccordionItem
4
+ component: BaseAccordionItem,
5
+ argTypes: {
6
+ // slots
7
+ header: {
8
+ control: false
9
+ },
10
+ heading: {
11
+ control: false
12
+ },
13
+ default: {
14
+ control: false
15
+ },
16
+ panelContents: {
17
+ control: false
18
+ }
19
+ }
6
20
  }
7
21
 
8
22
  // stories
9
23
  export const BaseStory = {
10
24
  name: 'BaseAccordionItem',
11
25
  args: {
12
- headingLevel: 'h3',
13
- item: { title: 'Title for the accordion', body: BlockStreamfieldTruncatedData.body }
26
+ headingLevel: 'h5',
27
+
28
+ item: {
29
+ title: 'Title for the accordion',
30
+ body: [{ text: 'No default body template. Customize with the `panelContents` slot.' }]
31
+ },
32
+
33
+ header: '<h3>Test</h3>'
14
34
  }
15
35
  }
@@ -1,25 +1,32 @@
1
1
  <script setup lang="ts">
2
+ /**
3
+ * Component that includes an accessible clickable header that will expand a panel below it
4
+ */
5
+
2
6
  import { computed, reactive, ref } from 'vue'
3
- import type { AccordionItemObject } from './../../interfaces.ts'
7
+ import type { AccordionItemObject, HeadingLevels } from './../../interfaces.ts'
4
8
  import { uniqueId } from 'lodash'
5
9
  import IconPlus from './../Icons/IconPlus.vue'
6
10
  import IconMinus from './../Icons/IconMinus.vue'
7
11
 
8
- export interface BaseAccordionItemProps {
9
- headingLevel?: string
10
- item: AccordionItemObject
11
- backgroundClass?: string
12
- }
13
-
14
- // define props
15
- const props = withDefaults(defineProps<BaseAccordionItemProps>(), {
16
- headingLevel: 'h2',
17
- backgroundClass: undefined,
18
- item(): AccordionItemObject {
19
- return {
20
- title: undefined,
21
- body: undefined
22
- }
12
+ const props = defineProps({
13
+ /**
14
+ * Semantic heading level
15
+ */
16
+ headingLevel: {
17
+ type: String as () => HeadingLevels,
18
+ default: 'h2'
19
+ },
20
+ /**
21
+ * Data object that includes all content that should be rendered in the accordion item
22
+ */
23
+ item: {
24
+ type: Object as () => AccordionItemObject,
25
+ default: () =>
26
+ ({
27
+ title: undefined,
28
+ body: undefined
29
+ }) as AccordionItemObject
23
30
  }
24
31
  })
25
32
 
@@ -37,6 +44,18 @@ const headingId = computed(() => {
37
44
  return `block_accordion_heading_${itemId.value}`
38
45
  })
39
46
 
47
+ const emit = defineEmits([
48
+ /**
49
+ * Fires when an item is opened
50
+ * @type {thing}
51
+ */
52
+ 'accordionItemOpened',
53
+ /**
54
+ * Fires when an item is closed
55
+ */
56
+ 'accordionItemClosed'
57
+ ])
58
+
40
59
  const handleClick = () => {
41
60
  ariaExpanded.value = !ariaExpanded.value
42
61
  isHidden.value = !isHidden.value
@@ -47,7 +66,27 @@ const handleClick = () => {
47
66
  }
48
67
  }
49
68
 
50
- const emit = defineEmits(['accordionItemOpened', 'accordionItemClosed'])
69
+ defineSlots<{
70
+ /**
71
+ * The entire clickable area of the item, including `heading`.
72
+ * Override with `<template #header>` and requires reconstructing `handleClick()` behavior.
73
+ */
74
+ header(): void
75
+ /**
76
+ * The heading text within the item header. Override with `<template #heading>`
77
+ */
78
+ heading(): void
79
+ /**
80
+ * The entire contents of expanded item, including `panelContents`.
81
+ * Override with `<template #default>` and requires reconstructing `aria-labelledby` attributes.
82
+ */
83
+ default(): void // Use 'void' as the return type
84
+ /**
85
+ * Contents of expanded accordion item. There is no default template.
86
+ * Override with `<template #panelContents>`
87
+ */
88
+ panelContents(): void
89
+ }>()
51
90
  </script>
52
91
  <template>
53
92
  <div
@@ -5,22 +5,20 @@ export default {
5
5
  component: BaseAudio,
6
6
  decorators: [
7
7
  () => ({
8
- template: `<div id="storyDecorator" class="bg-black p-4 pb-5"><story/></div>`
8
+ template: `<div id="storyRoot" class="bg-black p-4 pb-5"><story/></div>`
9
9
  })
10
10
  ],
11
11
  parameters: {
12
12
  html: {
13
- root: '#storyDecorator'
13
+ root: '#storyRoot'
14
14
  }
15
15
  },
16
16
  excludeStories: /.*Data$/
17
17
  }
18
18
 
19
- // shared data
20
- export const BaseAudioData = {
19
+ const BaseAudioData = {
21
20
  file: '/audio/file_example_MP3_700KB.mp3',
22
- autoPlay: false,
23
- loop: false
21
+ autoPlay: false
24
22
  }
25
23
 
26
24
  export const BaseStory = {
@@ -152,11 +152,17 @@ export default defineComponent({
152
152
  IconForwardTen
153
153
  },
154
154
  props: {
155
+ /**
156
+ * Path to audio file
157
+ */
155
158
  file: {
156
159
  type: String,
157
160
  default: null
158
161
  },
159
162
  autoPlay: {
163
+ /**
164
+ * If audio should play automatically
165
+ */
160
166
  type: Boolean,
161
167
  default: false
162
168
  }
@@ -1,44 +1,32 @@
1
- import BaseButton, { variants } from './BaseButton.vue'
1
+ import BaseButton from './BaseButton.vue'
2
2
 
3
3
  // TODO: add the rest of the button stories (icons, disabled, etc.)
4
4
  export default {
5
5
  title: 'Components/Base/BaseButton',
6
6
  component: BaseButton,
7
7
  excludeStories: /.*(Data)$/,
8
- tags: ['autodocs'],
9
8
  parameters: {
10
9
  slots: {
11
- default: 'BaseStory slot content'
10
+ default: 'The contents of the button, usually text. Override with `<template #default>`',
11
+ icon: 'Appears to the right of the `default` slot. Override with `<template #icon>`',
12
+ afterIcon: 'Appears to the right of the `icon` slot. Override with `<template #afterIcon>`'
12
13
  },
13
14
  docs: {
14
15
  description: {
15
- component: 'Simple button with several style variations.'
16
+ component: 'Simple button with style variations.'
16
17
  }
17
- }
18
- },
19
- argTypes: {
20
- ariaLabel: {
21
- type: 'string',
22
- description:
23
- "ARIA label. Recommended if your button label isn't descriptive, or if it only contains an icon."
24
18
  },
25
- variant: {
26
- type: 'string',
27
- description: 'Button variant type',
28
- control: {
29
- type: 'select'
30
- },
31
- options: Object.keys(variants),
32
- table: {
33
- defaultValue: { summary: 'default' }
34
- }
19
+ to: {
20
+ description: 'If populated, a router-link will be generated. Overrides `href`'
21
+ },
22
+ click: {
23
+ type: '@click emit'
35
24
  }
36
25
  }
37
26
  }
38
27
 
39
28
  export const BaseButtonData = {
40
- label: 'Explore',
41
- ariaLabel: 'Explore',
29
+ ariaLabel: 'Link to learn more',
42
30
  compact: false,
43
31
  disabled: false,
44
32
  to: '/',
@@ -63,4 +51,5 @@ export const DarkButton = {
63
51
  ...BaseButtonData,
64
52
  variant: 'dark'
65
53
  }
54
+ // globals: { themeVariant: 'ThemeVariantDark' }
66
55
  }
@@ -1,51 +1,68 @@
1
1
  <script lang="ts">
2
- import { defineComponent, resolveComponent } from 'vue'
2
+ import { defineComponent, resolveComponent, type PropType } from 'vue'
3
3
 
4
- interface Variants {
5
- [key: string]: string
6
- }
7
-
8
- export const variants: Variants = {
4
+ const variants = {
9
5
  primary: '-primary',
10
6
  secondary: '-secondary',
11
7
  dark: '-dark',
12
8
  social: '-social'
13
- }
9
+ } as const
10
+ type VariantsMapKey = keyof typeof variants
14
11
 
12
+ /**
13
+ * Simple button with style variations. Can be either a true `<button>` element or a link.
14
+ */
15
15
  export default defineComponent({
16
16
  name: 'BaseButton',
17
17
  props: {
18
+ /**
19
+ * Button style variants
20
+ */
18
21
  variant: {
19
- type: String,
22
+ type: String as PropType<VariantsMapKey>,
20
23
  required: false,
21
24
  default: 'primary',
22
25
  validator: (prop: string): boolean => Object.keys(variants).includes(prop)
23
26
  },
27
+ /** Removes extra left and right padding */
24
28
  compact: {
25
29
  type: Boolean,
26
30
  default: false,
27
31
  required: false
28
32
  },
33
+ /** Additional arbitrary classes to add to the button */
29
34
  blockClasses: {
30
35
  type: String,
31
36
  required: false,
32
37
  default: 'inline-block'
33
38
  },
39
+ /** If the button should render as disabled */
34
40
  disabled: {
35
41
  type: Boolean,
36
42
  default: false,
37
43
  required: false
38
44
  },
45
+ /**
46
+ * ARIA label. Recommended if your button text isn't descriptive, or if it only contains an icon.
47
+ */
39
48
  ariaLabel: {
40
49
  type: String,
41
50
  default: '',
42
51
  required: false
43
52
  },
53
+ /**
54
+ * If populated, a router-link will be generated. Overrides `href`.
55
+ * If both `to` and `href` are blank, a `<button>` element will be rendered.
56
+ * */
44
57
  to: {
45
58
  type: [String, Object],
46
59
  required: false,
47
60
  default: undefined
48
61
  },
62
+ /**
63
+ * Optional link for the button.
64
+ * If both `to` and `href` are blank, a `<button>` element will be rendered.
65
+ * */
49
66
  href: {
50
67
  type: String,
51
68
  required: false,
@@ -54,6 +71,9 @@ export default defineComponent({
54
71
  },
55
72
  emits: ['click'],
56
73
  computed: {
74
+ /**
75
+ * Whether the html element should be `<button>`, `<a>` or `<nuxt-link>`
76
+ */
57
77
  tag() {
58
78
  if (this.disabled) {
59
79
  return 'button'
@@ -65,6 +85,9 @@ export default defineComponent({
65
85
  return 'button'
66
86
  }
67
87
  },
88
+ /**
89
+ * Necessary for valid html. Guards for `<a>` or `<nuxt-link>` use-cases
90
+ */
68
91
  computedTo() {
69
92
  let toValue = this.to
70
93
  // filter out unnecessary `/home/` prefix from wagtail default site urlPaths
@@ -73,8 +96,9 @@ export default defineComponent({
73
96
  }
74
97
  return toValue
75
98
  },
76
- // necessary for valid html
77
- // must account for <a>, <nuxt-link>, and <button> use-cases
99
+ /**
100
+ * Necessary for valid html. Guards for `<a>` or `<nuxt-link>` use-cases
101
+ */
78
102
  theHref(): string | undefined {
79
103
  let href = undefined
80
104
  if (this.tag === 'a') {
@@ -2,7 +2,8 @@ import BaseCheckboxGroup from './BaseCheckboxGroup.vue'
2
2
 
3
3
  export default {
4
4
  title: 'Components/Base/BaseCheckboxGroup',
5
- component: BaseCheckboxGroup
5
+ component: BaseCheckboxGroup,
6
+ tags: ['forms']
6
7
  }
7
8
 
8
9
  // stories
@@ -71,26 +71,31 @@ import type { FormOption } from '../../interfaces'
71
71
  export default defineComponent({
72
72
  name: 'BaseCheckboxGroup',
73
73
  props: {
74
+ /** iContact group id */
74
75
  group: {
75
76
  type: String,
76
77
  default: null,
77
78
  required: false
78
79
  },
80
+ /** Heading */
79
81
  heading: {
80
82
  type: String,
81
83
  default: null,
82
84
  required: false
83
85
  },
86
+ /** Descriptive text or summary */
84
87
  subHeading: {
85
88
  type: String,
86
89
  default: null,
87
90
  required: false
88
91
  },
92
+ /** Fieldset title, for screen readers */
89
93
  title: {
90
94
  type: String,
91
95
  default: null,
92
96
  required: false
93
97
  },
98
+ /** Array of `{FormOption}s` */
94
99
  options: {
95
100
  type: Array as PropType<FormOption[]>,
96
101
  default: null,
@@ -6,24 +6,9 @@ import IconUser from './../Icons/IconUser.vue'
6
6
  export default {
7
7
  title: 'Components/Base/BaseHeading',
8
8
  component: BaseHeading,
9
- argTypes: {
10
- size: {
11
- type: { name: 'string', required: true },
12
- description: 'The display size of the heading.',
13
- control: { type: 'select' },
14
- options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']
15
- },
16
- level: {
17
- type: { name: 'string', required: false },
18
- description:
19
- 'The semantic heading tag if different from the display size (ex: a heading looks like an `h4`, but semantically, it is an `h1`.',
20
- control: { type: 'select' },
21
- options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']
22
- }
23
- },
24
9
  parameters: {
25
10
  slots: {
26
- default: 'BaseStory slot content'
11
+ default: 'The contents of the heading, usually text. Override with `<template #default>`'
27
12
  },
28
13
  docs: {
29
14
  description: {
@@ -71,4 +56,11 @@ const TemplateHeadingsWithIcons = (args) => ({
71
56
  })
72
57
 
73
58
  export const HeadingsWithIcons = TemplateHeadingsWithIcons.bind({})
74
- HeadingsWithIcons.args = { size: 'h1', level: 'h1', default: 'Heading 1' }
59
+ HeadingsWithIcons.args = { size: 'h3', level: 'h3', default: 'Heading 3 with Icon' }
60
+ HeadingsWithIcons.parameters = {
61
+ docs: {
62
+ description: {
63
+ story: 'Example of overriding the default slot to include an icon component.'
64
+ }
65
+ }
66
+ }
@@ -1,29 +1,39 @@
1
1
  <script lang="ts">
2
- import { defineComponent } from 'vue'
3
- import type { Attributes } from './../../interfaces'
4
- import type { PropType } from 'vue'
2
+ /** Base component for headings. Allows for retaining semantic markup while varying the text size. */
5
3
 
6
- export type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
4
+ import { defineComponent, type PropType } from 'vue'
7
5
 
8
- const headings: Attributes = {
6
+ type HeadingAttributes = {
7
+ h1: string
8
+ h2: string
9
+ h3: string
10
+ h4: string
11
+ h5: string
12
+ h6: string
13
+ }
14
+ export type HeadingLevel = keyof HeadingAttributes
15
+
16
+ const headings: HeadingAttributes = {
9
17
  h1: 'text-h1',
10
18
  h2: 'text-h2',
11
19
  h3: 'text-h3',
12
20
  h4: 'text-h4',
13
21
  h5: 'text-h5',
14
22
  h6: 'text-h6'
15
- }
23
+ } as const
16
24
 
17
25
  export default defineComponent({
18
26
  name: 'BaseHeading',
19
27
  props: {
28
+ /** The semantic heading tag if different from the display size (ex: a heading needs to look like an `h4`, but semantically is an `h1`. */
20
29
  level: {
21
- type: String as PropType<HeadingLevel | undefined>,
30
+ type: String as PropType<HeadingLevel>,
22
31
  required: false,
23
32
  default: 'h2'
24
33
  },
34
+ /** The display size of the heading */
25
35
  size: {
26
- type: String as PropType<HeadingLevel | '' | undefined>,
36
+ type: String as PropType<HeadingLevel>,
27
37
  required: false,
28
38
  default: ''
29
39
  }