@explorer-1/vue 0.1.4 → 0.1.6
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.
- package/components.d.ts +25 -3
- package/dist/explorer-1-vue.js +8978 -10024
- package/dist/explorer-1-vue.umd.cjs +13 -16
- package/dist/src/components/BaseHeading/BaseHeading.stories.d.ts +6 -11
- package/dist/src/components/BaseHeading/BaseHeading.vue.d.ts +6 -10
- package/dist/src/components/BasePlaceholder/BasePlaceholder.stories.d.ts +0 -1
- package/dist/src/components/BlockDialog/BlockDialog.stories.d.ts +81 -0
- package/dist/src/components/BlockImage/BlockImage.stories.d.ts +0 -1
- package/dist/src/components/BlockLinkCarousel/BlockLinkCarousel.stories.d.ts +6 -0
- package/dist/src/components/BlockLinkCarousel/BlockLinkCarousel.vue.d.ts +6 -0
- package/dist/src/components/BlockQuote/BlockQuote.stories.d.ts +0 -1
- package/dist/src/components/BlockStreamfield/BlockStreamfield.stories.d.ts +58 -8
- package/dist/src/components/BlockVideoEmbed/BlockVideoEmbed.vue.d.ts +7 -3
- package/dist/src/components/HeroListingIndex/HeroListingIndex.stories.d.ts +1 -0
- package/dist/src/components/HeroMedium/HeroMedium.stories.d.ts +1 -0
- package/dist/src/components/HeroMedium/HeroSmall.stories.d.ts +1 -0
- package/dist/src/components/HomepageEmbedBlock/HomepageEmbedBlock.stories.d.ts +1 -6
- package/dist/src/components/HomepageMissionsCarousel/HomepageMissionsCarousel.stories.d.ts +31 -47
- package/dist/src/components/HomepageMissionsCarousel/HomepageMissionsCarousel.vue.d.ts +5 -1
- package/dist/src/components/HomepageStats/HomepageStats.stories.d.ts +19 -9
- package/dist/src/components/HomepageTeaserBlock/HomepageTeaserBlock.stories.d.ts +6 -50
- package/dist/src/components/HomepageTeaserBlock/HomepageTeaserBlock.vue.d.ts +7 -1
- package/dist/src/components/MissionDetailAbout/MissionDetailAbout.stories.d.ts +1 -6
- package/dist/src/components/MissionDetailHero/MissionDetailHero.stories.d.ts +11 -11
- package/dist/src/components/MissionDetailHighlights/MissionDetailHighlights.stories.d.ts +6 -6
- package/dist/src/components/NavDesktop/NavDesktop.stories.d.ts +3 -6
- package/dist/src/components/NavDesktopEdu/NavDesktopEdu.stories.d.ts +289 -0
- package/dist/src/components/NavLogoLinks/NavLogoLinks.stories.d.ts +0 -5
- package/dist/src/components/NavMobile/NavMobile.stories.d.ts +42 -9
- package/dist/src/components/NavMobile/NavMobile.vue.d.ts +13 -2
- package/dist/src/components/NavMobile/NavMobileEdu.stories.d.ts +392 -0
- package/dist/src/components/NavSocial/NavSocial.stories.d.ts +42 -1
- package/dist/src/components/NavSocial/NavSocial.vue.d.ts +42 -1
- package/dist/src/components/TheFooter/TheFooter.vue.d.ts +9 -1
- package/dist/src/components/TimelineDialog/TimelineDialog.stories.d.ts +75 -0
- package/dist/src/components/TopicDetailMissionSpotlight/TopicDetailMissionSpotlight.stories.d.ts +1 -7
- package/dist/src/components/TopicDetailStreamfield/TopicDetailStreamfield.stories.d.ts +1 -6
- package/dist/src/docs/foundation/typography.stories.d.ts +6 -10
- package/dist/src/store/curatedGallery.d.ts +6 -0
- package/dist/src/store/search.d.ts +10 -0
- package/dist/src/templates/PageAudioDetail/PageAudioDetail.stories.d.ts +102 -0
- package/dist/src/templates/PageContent/PageContent.stories.d.ts +2 -1
- package/dist/src/templates/PageContent/PageContent.vue.d.ts +8 -1
- package/dist/src/templates/PageEventDetail/PageEventDetail.stories.d.ts +1 -1
- package/dist/src/templates/PageImageDetail/PageImageDetail.stories.d.ts +141 -0
- package/dist/src/templates/PageNewsDetail/PageNewsDetail.stories.d.ts +1163 -228
- package/dist/src/templates/PageVideoDetail/PageVideoDetail.stories.d.ts +56 -0
- package/dist/src/templates/edu/PageContentEdu.stories.d.ts +27 -0
- package/dist/src/templates/edu/PageEduNewsDetail/PageEduNewsDetail.stories.d.ts +360 -0
- package/dist/src/templates/edu/PageEduResourceArticle/PageEduResourceArticle.stories.d.ts +327 -0
- package/dist/src/templates/www/PageAsteroidWatchContent/PageAsteroidWatchContent.stories.d.ts +99 -0
- package/dist/src/templates/{edu/PageEduNewsDetail.stories.d.ts → www/PageAsteroidWatchIndex/PageAsteroidWatchIndex.stories.d.ts} +48 -67
- package/dist/src/templates/www/PageCuratedGallery/PageCuratedGallery.stories.d.ts +98 -0
- package/dist/src/templates/www/PageGoDirectory/PageGoDirectory.stories.d.ts +56 -0
- package/dist/src/templates/www/PageHomepage/PageHomepage.stories.d.ts +704 -0
- package/dist/src/templates/www/PageInfographicDetail/PageInfographicDetail.stories.d.ts +41 -0
- package/dist/src/templates/www/PageMaintenanceMode/PageMaintenanceMode.stories.d.ts +14 -0
- package/dist/src/templates/www/PageMissionDetail/PageMissionDetail.stories.d.ts +875 -0
- package/dist/src/templates/www/PagePodcast/PagePodcast.stories.d.ts +115 -0
- package/dist/src/templates/www/PagePodcastSeason/PagePodcastSeason.stories.d.ts +84 -0
- package/dist/src/templates/www/PagePressKitIndex/PagePressKitIndex.stories.d.ts +64 -0
- package/dist/src/templates/www/PageProfileDetail/PageProfileDetail.stories.d.ts +60 -0
- package/dist/src/templates/www/PageRoboticsDetail/PageRoboticsDetail.stories.d.ts +170 -0
- package/dist/src/templates/www/PageTimeline/PageTimeline.stories.d.ts +339 -0
- package/dist/src/templates/www/PageTopicDetail/PageTopicDetail.stories.d.ts +297 -0
- package/dist/style.css +1 -1
- package/lib/main.ts +4 -0
- package/package.json +2 -1
- package/src/components/BaseAudio/BaseAudio.vue +0 -1
- package/src/components/BaseHeading/BaseHeading.stories.js +0 -1
- package/src/components/BaseHeading/BaseHeading.vue +5 -7
- package/src/components/BasePlaceholder/BasePlaceholder.stories.js +0 -1
- package/src/components/BlockAudio/BlockAudio.stories.js +2 -3
- package/src/components/BlockDialog/BlockDialog.stories.js +56 -0
- package/src/components/BlockDialog/BlockDialog.stories.mdx +28 -0
- package/src/components/BlockDialog/BlockDialog.vue +132 -0
- package/src/components/BlockHeading/BlockHeading.stories.js +2 -2
- package/src/components/BlockImage/BlockImage.stories.js +0 -1
- package/src/components/BlockImageCarouselItem/BlockImageCarouselItem.vue +0 -1
- package/src/components/BlockImageGallery/BlockImageGallery.vue +0 -1
- package/src/components/BlockLinkCarousel/BlockLinkCarousel.vue +4 -2
- package/src/components/BlockQuote/BlockQuote.stories.js +0 -1
- package/src/components/BlockStreamfield/BlockStreamfield.stories.js +20 -9
- package/src/components/BlockVideoEmbed/BlockVideoEmbed.vue +3 -2
- package/src/components/DetailHeadline/DetailHeadline.vue +3 -2
- package/src/components/DsnWidget/DsnWidget.vue +2 -2
- package/src/components/HomepageEmbedBlock/HomepageEmbedBlock.stories.js +1 -8
- package/src/components/HomepageMissionsCarousel/HomepageMissionsCarousel.stories.js +115 -118
- package/src/components/HomepageMissionsCarousel/HomepageMissionsCarousel.vue +3 -23
- package/src/components/HomepageMissionsCarousel/HomepageMissionsCarouselItem.vue +1 -2
- package/src/components/HomepageStats/HomepageStats.stories.js +10 -10
- package/src/components/HomepageStats/HomepageStats.vue +8 -8
- package/src/components/HomepageTeaserBlock/HomepageTeaserBlock.stories.js +11 -18
- package/src/components/HomepageTeaserBlock/HomepageTeaserBlock.vue +20 -14
- package/src/components/HomepageTeaserBlock/HomepageTeaserBlockCardImage.vue +1 -1
- package/src/components/MissionDetailAbout/MissionDetailAbout.stories.js +1 -8
- package/src/components/MissionDetailHero/MissionDetailHero.stories.js +11 -11
- package/src/components/MissionDetailHighlights/MissionDetailHighlights.stories.js +6 -6
- package/src/components/MixinCarousel/MixinCarousel.docs.mdx +1 -1
- package/src/components/NavDesktop/NavDesktop.stories.js +1 -4
- package/src/components/NavDesktopEdu/NavDesktopEdu.stories.js +2 -1
- package/src/components/NavMobile/NavMobileEdu.stories.js +2 -1
- package/src/components/RoboticsDetailStats/RoboticsDetailStats.stories.js +1 -1
- package/src/components/TimelineDialog/TimelineDialog.stories.js +47 -0
- package/src/components/TimelineDialog/TimelineDialog.stories.mdx +26 -0
- package/src/components/TimelineDialog/TimelineDialog.vue +145 -0
- package/src/components/TopicDetailMissionSpotlight/TopicDetailMissionSpotlight.stories.js +1 -9
- package/src/components/TopicDetailStreamfield/TopicDetailStreamfield.stories.js +1 -8
- package/src/docs/utils/ComponentItem.jsx +0 -1
- package/src/store/curatedGallery.ts +23 -0
- package/src/store/search.ts +43 -0
- package/src/templates/PageAudioDetail/PageAudioDetail.stories.js +106 -0
- package/src/templates/PageAudioDetail/PageAudioDetail.vue +375 -0
- package/src/templates/PageContent/PageContent.stories.js +2 -1
- package/src/templates/PageContent/PageContent.vue +16 -19
- package/src/templates/PageEventDetail/PageEventDetail.stories.js +1 -1
- package/src/templates/PageEventDetail/PageEventDetail.vue +15 -15
- package/src/templates/PageImageDetail/PageImageDetail.stories.js +116 -0
- package/src/templates/PageImageDetail/PageImageDetail.vue +444 -0
- package/src/templates/PageNewsDetail/PageNewsDetail.stories.js +3 -2
- package/src/templates/PageNewsDetail/PageNewsDetail.vue +4 -5
- package/src/templates/PageVideoDetail/PageVideoDetail.stories.js +84 -0
- package/src/templates/PageVideoDetail/PageVideoDetail.vue +173 -0
- package/src/templates/edu/PageContentEdu.stories.js +1 -0
- package/src/templates/edu/{PageEduNewsDetail.stories.js → PageEduNewsDetail/PageEduNewsDetail.stories.js} +5 -3
- package/src/templates/edu/{PageEduNewsDetail.vue → PageEduNewsDetail/PageEduNewsDetail.vue} +3 -2
- package/src/templates/edu/PageEduResourceArticle/PageEduResourceArticle.stories.js +192 -0
- package/src/templates/edu/PageEduResourceArticle/PageEduResourceArticle.vue +196 -0
- package/src/templates/www/PageAsteroidWatchContent/PageAsteroidWatchContent.stories.js +54 -0
- package/src/templates/www/PageAsteroidWatchContent/PageAsteroidWatchContent.vue +79 -0
- package/src/templates/www/PageAsteroidWatchIndex/PageAsteroidWatchIndex.stories.js +34 -0
- package/src/templates/www/PageAsteroidWatchIndex/PageAsteroidWatchIndex.vue +56 -0
- package/src/templates/www/PageCuratedGallery/PageCuratedGallery.stories.js +110 -0
- package/src/templates/www/PageCuratedGallery/PageCuratedGallery.vue +345 -0
- package/src/templates/www/PageGoDirectory/PageGoDirectory.stories.js +61 -0
- package/src/templates/www/PageGoDirectory/PageGoDirectory.vue +76 -0
- package/src/templates/www/PageHomepage/PageHomepage.stories.js +101 -0
- package/src/templates/www/PageHomepage/PageHomepage.vue +136 -0
- package/src/templates/www/PageInfographicDetail/PageInfographicDetail.stories.js +46 -0
- package/src/templates/www/PageInfographicDetail/PageInfographicDetail.vue +125 -0
- package/src/templates/www/PageMaintenanceMode/PageMaintenanceMode.stories.js +14 -0
- package/src/templates/www/PageMaintenanceMode/PageMaintenanceMode.vue +94 -0
- package/src/templates/www/PageMissionDetail/PageMissionDetail.stories.js +246 -0
- package/src/templates/www/PageMissionDetail/PageMissionDetail.vue +136 -0
- package/src/templates/www/PagePodcast/PagePodcast.stories.js +86 -0
- package/src/templates/www/PagePodcast/PagePodcast.vue +219 -0
- package/src/templates/www/PagePodcastSeason/PagePodcastSeason.stories.js +96 -0
- package/src/templates/www/PagePodcastSeason/PagePodcastSeason.vue +191 -0
- package/src/templates/www/PagePressKitIndex/PagePressKitIndex.stories.js +72 -0
- package/src/templates/www/PagePressKitIndex/PagePressKitIndex.vue +76 -0
- package/src/templates/www/PageProfileDetail/PageProfileDetail.stories.js +76 -0
- package/src/templates/www/PageProfileDetail/PageProfileDetail.vue +178 -0
- package/src/templates/www/PageRoboticsDetail/PageRoboticsDetail.stories.js +43 -0
- package/src/templates/www/PageRoboticsDetail/PageRoboticsDetail.vue +101 -0
- package/src/templates/www/PageTimeline/BlockMilestone.vue +99 -0
- package/src/templates/www/PageTimeline/PageTimeline.stories.js +357 -0
- package/src/templates/www/PageTimeline/PageTimeline.vue +384 -0
- package/src/templates/www/PageTopicDetail/PageTopicDetail.stories.js +87 -0
- package/src/templates/www/PageTopicDetail/PageTopicDetail.vue +121 -0
- package/src/utils/mixins.ts +1 -1
- package/src/templates/www/HomePage/HomePage.vue +0 -30
- /package/dist/src/components/{MixinDropdownToggle/MixinDropdownToggle.vue.d.ts → NavDropdownToggle/NavDropdownToggle.vue.d.ts} +0 -0
package/lib/main.ts
CHANGED
|
@@ -4,8 +4,10 @@ import filters from './../src/utils/filters'
|
|
|
4
4
|
import type { Explorer1Theme } from '../src/interfaces'
|
|
5
5
|
|
|
6
6
|
// stores
|
|
7
|
+
import { useCuratedGalleryStore } from './../src/store/curatedGallery'
|
|
7
8
|
import { useHeaderStore } from './../src/store/header'
|
|
8
9
|
import { useThemeStore } from './../src/store/theme'
|
|
10
|
+
import { useSearchStore } from './../src/store/search'
|
|
9
11
|
// mixins
|
|
10
12
|
import {
|
|
11
13
|
mixinTransparentHeader,
|
|
@@ -211,7 +213,9 @@ export {
|
|
|
211
213
|
type Explorer1Theme,
|
|
212
214
|
dayjs,
|
|
213
215
|
filters,
|
|
216
|
+
useCuratedGalleryStore,
|
|
214
217
|
useHeaderStore,
|
|
218
|
+
useSearchStore,
|
|
215
219
|
useThemeStore,
|
|
216
220
|
mixinTransparentHeader,
|
|
217
221
|
mixinGetLinkText,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@explorer-1/vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
35
|
+
"a11y-dialog": "^8.0.4",
|
|
35
36
|
"autoprefixer": "^10.4.19",
|
|
36
37
|
"postcss": "^8.4.38",
|
|
37
38
|
"postcss-import": "^16.1.0",
|
|
@@ -18,16 +18,14 @@ export default defineComponent({
|
|
|
18
18
|
name: 'BaseHeading',
|
|
19
19
|
props: {
|
|
20
20
|
level: {
|
|
21
|
-
type:
|
|
21
|
+
type: String as PropType<HeadingLevel | undefined>,
|
|
22
22
|
required: false,
|
|
23
|
-
default: 'h2'
|
|
24
|
-
validator: (prop: string): boolean => Object.keys(headings).includes(prop)
|
|
23
|
+
default: 'h2'
|
|
25
24
|
},
|
|
26
25
|
size: {
|
|
27
|
-
type: String as PropType<HeadingLevel>,
|
|
26
|
+
type: String as PropType<HeadingLevel | '' | undefined>,
|
|
28
27
|
required: false,
|
|
29
|
-
default: ''
|
|
30
|
-
validator: (prop: string): boolean => Object.keys(headings).includes(prop)
|
|
28
|
+
default: ''
|
|
31
29
|
}
|
|
32
30
|
},
|
|
33
31
|
computed: {
|
|
@@ -35,7 +33,7 @@ export default defineComponent({
|
|
|
35
33
|
if (this.level) {
|
|
36
34
|
return this.level
|
|
37
35
|
} else {
|
|
38
|
-
return this.size
|
|
36
|
+
return this.size || 'h2'
|
|
39
37
|
}
|
|
40
38
|
},
|
|
41
39
|
computedClass(): string {
|
|
@@ -5,7 +5,6 @@ export default {
|
|
|
5
5
|
component: BasePlaceholder,
|
|
6
6
|
excludeStories: /.*Data$/,
|
|
7
7
|
parameters: {
|
|
8
|
-
viewMode: 'docs',
|
|
9
8
|
docs: {
|
|
10
9
|
description: {
|
|
11
10
|
component: `An animated loading component frequently used as a placeholder for <a href="/story/components-search-searchresultcard--standard-result" target="_blank">SearchResultCard</a>`
|
|
@@ -15,12 +15,11 @@ export const BlockAudioData = {
|
|
|
15
15
|
path: '0001'
|
|
16
16
|
},
|
|
17
17
|
createdAt: '2020-12-10T07:38:30.951546+00:00',
|
|
18
|
-
file: '
|
|
18
|
+
file: '/audio/file_example_MP3_700KB.mp3',
|
|
19
19
|
fileExtension: 'mp3',
|
|
20
20
|
fileOgg: '',
|
|
21
21
|
id: '1',
|
|
22
|
-
sources:
|
|
23
|
-
"[{'src': 'http://127.0.0.1:9000/media/media/05_Da_Funk_Call_Out_Research_Hook.mp3', 'type': 'audio/mpeg'}]",
|
|
22
|
+
sources: "[{'src': '/audio/file_example_MP3_700KB.mp3', 'type': 'audio/mpeg'}]",
|
|
24
23
|
thumbnail: '',
|
|
25
24
|
title: 'audio file',
|
|
26
25
|
type: 'audio'
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import BlockDialog from './BlockDialog.vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/Blocks/BlockDialog',
|
|
5
|
+
component: BlockDialog,
|
|
6
|
+
argTypes: {
|
|
7
|
+
overlayClose: { control: { type: 'boolean' } }
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const BaseStory = {
|
|
12
|
+
name: 'BlockDialog',
|
|
13
|
+
args: {
|
|
14
|
+
dialogId: 'dialog-id',
|
|
15
|
+
headingId: 'heading-id'
|
|
16
|
+
},
|
|
17
|
+
render: (args) => ({
|
|
18
|
+
components: { BlockDialog },
|
|
19
|
+
setup() {
|
|
20
|
+
return { args }
|
|
21
|
+
},
|
|
22
|
+
template: `<div>
|
|
23
|
+
<button type="button" data-a11y-dialog-show="dialog-id">Open the dialog</button>
|
|
24
|
+
<BlockDialog v-bind="args" dialog-box-class="max-w-2xl">
|
|
25
|
+
<div class="p-3 sm:p-5">
|
|
26
|
+
<h2 id="heading-id">Dialog title</h2>
|
|
27
|
+
<hr
|
|
28
|
+
aria-hidden="true"
|
|
29
|
+
class="bg-gray-light-mid w-full h-2px border-0 my-3"
|
|
30
|
+
/>
|
|
31
|
+
<div class="dialog-main py-3 max-h-64 overflow-auto relative">
|
|
32
|
+
<p class="py-2">
|
|
33
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
34
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
|
|
35
|
+
enim ad minim veniam, quis nostrud exercitation ullamco laboris
|
|
36
|
+
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
|
|
37
|
+
in reprehenderit in voluptate velit esse cillum dolore eu fugiat
|
|
38
|
+
nulla pariatur. Excepteur sint occaecat cupidatat non proident,
|
|
39
|
+
sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
40
|
+
</p>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="my-3">
|
|
43
|
+
<a
|
|
44
|
+
href="#"
|
|
45
|
+
target=""
|
|
46
|
+
rel=""
|
|
47
|
+
class="group cursor-pointer -default underline text-theme-color can-hover:hover:text-theme-color-hover"
|
|
48
|
+
>
|
|
49
|
+
<span class="break-words">Explore</span>
|
|
50
|
+
</a>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</BlockDialog>
|
|
54
|
+
</div>`
|
|
55
|
+
})
|
|
56
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Meta, Story, Canvas } from '@storybook/addon-docs'
|
|
2
|
+
import * as Stories from './BlockDialog.stories'
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# BlockDialog
|
|
7
|
+
|
|
8
|
+
This component is an accessible dialog window that utilizes the efficient and lightweight `a11y-dialog` package.
|
|
9
|
+
It adheres to the [Dialog (Modal) pattern](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/) outlined in the Accessible Rich Internet Applications (ARIA) Authoring Practices Guide.
|
|
10
|
+
|
|
11
|
+
Additionally, it is unopinionated with styling.
|
|
12
|
+
|
|
13
|
+
<Canvas
|
|
14
|
+
of={Stories.BaseStory}
|
|
15
|
+
className="sbdocs-preview-full-width"
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
### Basic Usage
|
|
19
|
+
|
|
20
|
+
To trigger dialog opening, use the `data-a11y-dialog-show` attribute with the value set to the `id` of the dialog element you want to open.
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
<button type="button" data-a11y-dialog-show="your-dialog-id">
|
|
24
|
+
Open the dialog
|
|
25
|
+
</button>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
See [all documentation in the repository](https://github.com/KittyGiraudel/a11y-dialog).
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="dialogId"
|
|
4
|
+
:id="dialogId"
|
|
5
|
+
ref="DialogRef"
|
|
6
|
+
:aria-labelledby="headingId"
|
|
7
|
+
aria-hidden="true"
|
|
8
|
+
class="BlockDialog fixed top-0 left-0 z-60 flex w-full h-full overflow-auto"
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
class="dialog-overlay bg-gray-dark bg-opacity-90 fixed top-0 left-0 w-full h-full"
|
|
12
|
+
:data-a11y-dialog-hide="overlayClose ? '' : undefined"
|
|
13
|
+
></div>
|
|
14
|
+
<div class="container px-4 m-auto">
|
|
15
|
+
<div
|
|
16
|
+
role="document"
|
|
17
|
+
class="dialog-box relative m-auto bg-white"
|
|
18
|
+
:class="dialogBoxClass"
|
|
19
|
+
>
|
|
20
|
+
<button
|
|
21
|
+
type="button"
|
|
22
|
+
data-a11y-dialog-hide
|
|
23
|
+
aria-label="Close dialog"
|
|
24
|
+
class="button-close absolute right-0 flex-shrink-0 text-white focus:outline-none focus:ring-2"
|
|
25
|
+
>
|
|
26
|
+
<IconClose />
|
|
27
|
+
</button>
|
|
28
|
+
<slot>Content</slot>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script lang="ts">
|
|
35
|
+
import { defineComponent } from 'vue'
|
|
36
|
+
import A11yDialog from 'a11y-dialog'
|
|
37
|
+
import IconClose from './../Icons/IconClose.vue'
|
|
38
|
+
|
|
39
|
+
export default defineComponent({
|
|
40
|
+
name: 'BlockDialog',
|
|
41
|
+
components: {
|
|
42
|
+
IconClose
|
|
43
|
+
},
|
|
44
|
+
props: {
|
|
45
|
+
dialogId: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: true
|
|
48
|
+
},
|
|
49
|
+
headingId: {
|
|
50
|
+
type: String,
|
|
51
|
+
required: false,
|
|
52
|
+
default: ''
|
|
53
|
+
},
|
|
54
|
+
overlayClose: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
required: false,
|
|
57
|
+
default: true
|
|
58
|
+
},
|
|
59
|
+
dialogBoxClass: {
|
|
60
|
+
type: String,
|
|
61
|
+
required: false,
|
|
62
|
+
default: ''
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
emits: ['show', 'hide'],
|
|
66
|
+
data(): {
|
|
67
|
+
dialog: A11yDialog | null
|
|
68
|
+
content: HTMLElement | null
|
|
69
|
+
} {
|
|
70
|
+
return {
|
|
71
|
+
dialog: null,
|
|
72
|
+
content: null
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
mounted() {
|
|
76
|
+
this.init()
|
|
77
|
+
;(this.dialog as A11yDialog).show()
|
|
78
|
+
},
|
|
79
|
+
beforeUnmount() {
|
|
80
|
+
if (this.dialog) {
|
|
81
|
+
this.dialog.destroy()
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
methods: {
|
|
85
|
+
init() {
|
|
86
|
+
this.dialog = this.$refs.DialogRef
|
|
87
|
+
? new A11yDialog(this.$refs.DialogRef as HTMLElement)
|
|
88
|
+
: null
|
|
89
|
+
console.log(this.dialog)
|
|
90
|
+
if (this.dialog) {
|
|
91
|
+
this.dialog
|
|
92
|
+
.on('show', () => {
|
|
93
|
+
document.body.classList.add('overflow-hidden')
|
|
94
|
+
this.$emit('show')
|
|
95
|
+
})
|
|
96
|
+
.on('hide', () => {
|
|
97
|
+
document.body.classList.remove('overflow-hidden')
|
|
98
|
+
this.$emit('hide')
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
</script>
|
|
105
|
+
<style lang="scss">
|
|
106
|
+
.BlockDialog {
|
|
107
|
+
// Make sure the dialog container and all its descendants are not visible and not focusable when it is hidden.
|
|
108
|
+
&[aria-hidden='true'] {
|
|
109
|
+
display: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@media (forced-colors: active) {
|
|
113
|
+
.dialog-box {
|
|
114
|
+
border: 1px solid;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.dialog-overlay,
|
|
119
|
+
.dialog-box {
|
|
120
|
+
@apply animate-fadeIn;
|
|
121
|
+
|
|
122
|
+
@media (prefers-reduced-motion: reduce) {
|
|
123
|
+
animation: none;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Offset by the size of the icon.
|
|
128
|
+
.button-close {
|
|
129
|
+
top: -2rem;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
</style>
|
|
@@ -46,11 +46,13 @@ export default defineComponent({
|
|
|
46
46
|
},
|
|
47
47
|
items: {
|
|
48
48
|
type: Array,
|
|
49
|
-
required: false
|
|
49
|
+
required: false,
|
|
50
|
+
default: undefined
|
|
50
51
|
},
|
|
51
52
|
heading: {
|
|
52
53
|
type: String,
|
|
53
|
-
required: false
|
|
54
|
+
required: false,
|
|
55
|
+
default: undefined
|
|
54
56
|
}
|
|
55
57
|
},
|
|
56
58
|
computed: {
|
|
@@ -25,20 +25,31 @@ export default {
|
|
|
25
25
|
options: Object.keys(variants)
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
|
-
decorators: [
|
|
29
|
-
() => ({
|
|
30
|
-
template: `<div id="storyDecorator" class="absolute inset-0"><story/></div>`
|
|
31
|
-
})
|
|
32
|
-
],
|
|
33
28
|
parameters: {
|
|
34
|
-
|
|
35
|
-
root: '#storyDecorator'
|
|
36
|
-
},
|
|
37
|
-
viewMode: 'canvas'
|
|
29
|
+
layout: 'fullscreen'
|
|
38
30
|
},
|
|
39
31
|
excludeStories: /.*(Data)$/
|
|
40
32
|
}
|
|
41
33
|
|
|
34
|
+
export const BlockStreamfieldTruncatedData = {
|
|
35
|
+
body: [
|
|
36
|
+
BlockKeyPointsData,
|
|
37
|
+
BlockHeadingData,
|
|
38
|
+
{
|
|
39
|
+
blockType: 'RichTextBlock',
|
|
40
|
+
value:
|
|
41
|
+
'<p>Lorem ipsum <a href="/missions/test-mission/">dolor</a> sit amet, consectetur adipiscing elit. Quisque vitae justo quis justo malesuada molestie. Cras sed tincidunt dui.</p><p>Integer imperdiet blandit neque vitae euismod. Nulla aliquet lacus nibh, vel tincidunt urna efficitur non. In et eros vitae ex posuere maximus quis eget urna. Suspendisse fringilla posuere velit sit amet posuere. Morbi malesuada bibendum vehicula. Donec faucibus ut erat ut mattis. Suspendisse ornare, quam at placerat cursus, dolor mi lacinia nunc, eget maximus augue nulla in dolor.</p>\n'
|
|
42
|
+
},
|
|
43
|
+
BlockImageComparisonData,
|
|
44
|
+
BlockHeadingData,
|
|
45
|
+
{
|
|
46
|
+
blockType: 'RichTextBlock',
|
|
47
|
+
value:
|
|
48
|
+
'<p>Lorem ipsum <a href="/missions/test-mission/">dolor</a> sit amet, consectetur adipiscing elit. Quisque vitae justo quis justo malesuada molestie. Cras sed tincidunt dui.</p><p>Integer imperdiet blandit neque vitae euismod. Nulla aliquet lacus nibh, vel tincidunt urna efficitur non. In et eros vitae ex posuere maximus quis eget urna. Suspendisse fringilla posuere velit sit amet posuere. Morbi malesuada bibendum vehicula. Donec faucibus ut erat ut mattis. Suspendisse ornare, quam at placerat cursus, dolor mi lacinia nunc, eget maximus augue nulla in dolor.</p>\n'
|
|
49
|
+
},
|
|
50
|
+
BlockIframeEmbedData
|
|
51
|
+
]
|
|
52
|
+
}
|
|
42
53
|
export const BlockStreamfieldData = {
|
|
43
54
|
body: [
|
|
44
55
|
BlockKeyPointsData,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
variant="secondary"
|
|
13
13
|
:to="topics[0].url"
|
|
14
14
|
class="py-3"
|
|
15
|
-
use-primary-color
|
|
15
|
+
:use-primary-color="themeStore.theme === 'ThemeEdu'"
|
|
16
16
|
>
|
|
17
17
|
<span :itemprop="schema ? 'articleSection' : undefined">
|
|
18
18
|
{{ topics[0].title }}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</div>
|
|
22
22
|
<span
|
|
23
23
|
v-else-if="label"
|
|
24
|
-
class="text-subtitle py-3"
|
|
24
|
+
class="text-subtitle py-3 edu:text-primary"
|
|
25
25
|
>
|
|
26
26
|
<template v-if="!labelLink">
|
|
27
27
|
{{ label }}
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
variant="secondary"
|
|
32
32
|
:to="labelLink"
|
|
33
33
|
class="py-3"
|
|
34
|
+
:use-primary-color="themeStore.theme === 'ThemeEdu'"
|
|
34
35
|
>
|
|
35
36
|
{{ label }}
|
|
36
37
|
</BaseLink>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
>
|
|
13
13
|
<p
|
|
14
14
|
v-if="data.heading"
|
|
15
|
-
class="text-subtitle text-
|
|
15
|
+
class="text-subtitle text-primary mb-4"
|
|
16
16
|
>
|
|
17
17
|
{{ data.heading }}
|
|
18
18
|
</p>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<template v-else>
|
|
22
22
|
<p
|
|
23
23
|
v-if="data.heading"
|
|
24
|
-
class="text-subtitle text-
|
|
24
|
+
class="text-subtitle text-primary mb-4"
|
|
25
25
|
>
|
|
26
26
|
{{ data.heading }}
|
|
27
27
|
</p>
|
|
@@ -4,15 +4,8 @@ import HomepageEmbedBlock from './HomepageEmbedBlock.vue'
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Components/WWW/Homepage/HomepageEmbedBlock',
|
|
6
6
|
component: HomepageEmbedBlock,
|
|
7
|
-
decorators: [
|
|
8
|
-
() => ({
|
|
9
|
-
template: `<div id="storyDecorator" class="absolute inset-0"><story/></div>`
|
|
10
|
-
})
|
|
11
|
-
],
|
|
12
7
|
parameters: {
|
|
13
|
-
|
|
14
|
-
root: '#storyDecorator'
|
|
15
|
-
},
|
|
8
|
+
layout: 'fullscreen',
|
|
16
9
|
viewMode: 'canvas'
|
|
17
10
|
},
|
|
18
11
|
excludeStories: /.*(Data)$/
|