@explorer-1/vue 0.2.8 → 0.2.10
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 +6 -1
- package/dist/explorer-1-vue.js +6871 -6420
- package/dist/explorer-1-vue.umd.cjs +13 -13
- package/dist/src/components/{BaseTag/BaseTag.stories.d.ts → BasePill/BasePill.stories.d.ts} +2 -2
- package/dist/src/components/{BaseTag/BaseTag.vue.d.ts → BasePill/BasePill.vue.d.ts} +7 -3
- package/dist/src/components/BlockLinkCard/BlockLinkCard.stories.d.ts +89 -15
- package/dist/src/components/BlockLinkCard/BlockLinkCard.vue.d.ts +66 -7
- package/dist/src/components/BlockLinkCarousel/BlockLinkCarousel.stories.d.ts +70 -2
- package/dist/src/components/BlockLinkTile/BlockLinkTile.vue.d.ts +4 -4
- package/dist/src/components/CalendarButton/CalendarButton.vue.d.ts +2 -2
- package/dist/src/components/CalendarChip/CalendarChip.vue.d.ts +36 -0
- package/dist/src/components/EventCard/EventCard.vue.d.ts +9 -0
- package/dist/src/components/EventDetailHero/EventDetailHero.vue.d.ts +27 -9
- package/dist/src/components/HeroListingIndex/HeroListingIndex.stories.d.ts +1 -0
- package/dist/src/components/HeroListingIndex/HeroListingIndex.vue.d.ts +6 -4
- package/dist/src/components/HeroMedium/HeroMedium.vue.d.ts +28 -2
- package/dist/src/components/Icons/IconProfile.vue.d.ts +2 -0
- package/dist/src/components/Icons/IconSubject.vue.d.ts +2 -0
- package/dist/src/components/Icons/Icons.stories.d.ts +17 -0
- package/dist/src/components/MetadataEduResource/MetadataEduResource.stories.d.ts +55 -0
- package/dist/src/components/MetadataEduResource/MetadataEduResource.vue.d.ts +38 -0
- package/dist/src/components/MetadataEvent/MetadataEvent.stories.d.ts +29 -0
- package/dist/src/components/MetadataEvent/MetadataEvent.vue.d.ts +38 -0
- package/dist/src/components/NavDesktopEdu/NavDesktopEdu.stories.d.ts +1 -0
- package/dist/src/components/SearchResultCard/SearchResultCard.stories.d.ts +23 -4
- package/dist/src/components/SearchResultCard/SearchResultCard.vue.d.ts +66 -1
- package/dist/src/components/SearchResultGridItem/SearchResultGridItem.stories.d.ts +7 -0
- package/dist/src/components/SearchResultGridItem/SearchResultGridItem.vue.d.ts +65 -11
- package/dist/src/components/SearchResultsList/SearchResultsList.stories.d.ts +404 -0
- package/dist/src/components/TopicDetailMoreItem/TopicDetailMoreItem.vue.d.ts +8 -4
- package/dist/src/constants.d.ts +4 -0
- package/dist/src/interfaces.d.ts +38 -3
- package/dist/src/templates/PageContent/PageContent.stories.d.ts +1 -0
- package/dist/src/templates/PageEventDetail/PageEventDetail.stories.d.ts +2 -13
- package/dist/src/templates/PageEventDetail/PageEventDetail.vue.d.ts +6 -3
- package/dist/src/templates/edu/PageEduEventDetail/PageEduEventDetail.stories.d.ts +153 -31
- package/dist/src/utils/mixins.d.ts +1 -1
- package/dist/src/utils/rangeifyGrades.d.ts +3 -0
- package/dist/style.css +1 -1
- package/lib/main.ts +2 -2
- package/package.json +2 -2
- package/src/components/{BaseTag/BaseTag.stories.js → BasePill/BasePill.stories.js} +3 -3
- package/src/components/BasePill/BasePill.vue +54 -0
- package/src/components/BaseTimer/BaseTimer.vue +1 -1
- package/src/components/BlockLinkCard/BlockLinkCard.stories.js +93 -12
- package/src/components/BlockLinkCard/BlockLinkCard.vue +180 -39
- package/src/components/BlockLinkCarousel/BlockLinkCarousel.stories.js +60 -3
- package/src/components/BlockLinkTile/BlockLinkTile.vue +11 -8
- package/src/components/CalendarChip/CalendarChip.vue +52 -0
- package/src/components/DetailHeadline/DetailHeadline.vue +5 -5
- package/src/components/EventCard/EventCard.vue +28 -88
- package/src/components/EventDetailHero/EventDetailHero.vue +18 -25
- package/src/components/HeroLarge/HeroLarge.stories.js +20 -0
- package/src/components/HeroListingIndex/HeroListingIndex.stories.js +1 -0
- package/src/components/HeroListingIndex/HeroListingIndex.vue +8 -3
- package/src/components/HeroMedium/HeroMedium.vue +24 -12
- package/src/components/HomepageCarouselItem/HomepageCarouselItem.stories.js +1 -1
- package/src/components/HomepageCarouselItem/HomepageCarouselItem.vue +8 -8
- package/src/components/Icons/IconProfile.vue +30 -0
- package/src/components/Icons/IconSubject.vue +38 -0
- package/src/components/Icons/Icons.stories.ts +15 -0
- package/src/components/MetadataEduResource/MetadataEduResource.stories.js +59 -0
- package/src/components/MetadataEduResource/MetadataEduResource.vue +93 -0
- package/src/components/MetadataEvent/MetadataEvent.stories.js +31 -0
- package/src/components/MetadataEvent/MetadataEvent.vue +164 -0
- package/src/components/SearchResultCard/SearchResultCard.stories.js +22 -5
- package/src/components/SearchResultCard/SearchResultCard.vue +71 -14
- package/src/components/SearchResultGridItem/SearchResultGridItem.stories.js +8 -1
- package/src/components/SearchResultGridItem/SearchResultGridItem.vue +81 -31
- package/src/components/SearchResultsList/SearchResultsList.stories.js +1197 -0
- package/src/components/SearchResultsList/SearchResultsList.vue +1 -0
- package/src/components/TopicDetailMoreItem/TopicDetailMoreItem.vue +12 -8
- package/src/constants.ts +20 -0
- package/src/interfaces.ts +41 -3
- package/src/templates/PageContent/PageContent.stories.js +1 -0
- package/src/templates/PageEventDetail/PageEventDetail.stories.js +1 -1
- package/src/templates/PageEventDetail/PageEventDetail.vue +25 -90
- package/src/templates/PageVideoDetail/PageVideoDetail.stories.js +2 -1
- package/src/templates/PageVideoDetail/PageVideoDetail.vue +4 -4
- package/src/templates/edu/PageEduEventDetail/PageEduEventDetail.stories.js +3 -2
- package/src/templates/edu/PageEduEventDetail/PageEduEventDetail.vue +38 -123
- package/src/templates/www/PageAsteroidWatchIndex/PageAsteroidWatchIndex.stories.js +22 -1
- package/src/templates/www/PageAsteroidWatchIndex/PageAsteroidWatchIndex.vue +1 -1
- package/src/templates/www/PageInfographicDetail/PageInfographicDetail.stories.js +1 -1
- package/src/templates/www/PageInfographicDetail/PageInfographicDetail.vue +2 -2
- package/src/templates/www/PagePodcastSeason/PagePodcastSeason.stories.js +1 -1
- package/src/templates/www/PagePodcastSeason/PagePodcastSeason.vue +1 -1
- package/src/templates/www/PageRoboticsDetail/PageRoboticsDetail.vue +1 -1
- package/src/templates/www/PageTopicDetail/PageTopicDetail.stories.js +1 -1
- package/src/templates/www/PageTopicDetail/PageTopicDetail.vue +1 -1
- package/src/utils/mixins.ts +1 -1
- package/src/utils/rangeifyGrades.ts +76 -0
- package/src/components/BaseTag/BaseTag.vue +0 -36
|
@@ -25,7 +25,28 @@ export const BaseStory = {
|
|
|
25
25
|
name: 'PageAsteroidWatchIndex',
|
|
26
26
|
args: {
|
|
27
27
|
data: {
|
|
28
|
-
|
|
28
|
+
description:
|
|
29
|
+
'Crawl, walk and even climb rock walls, this robot was designed to operate in extreme terrains.',
|
|
30
|
+
listingPageHeroImage: {
|
|
31
|
+
// beach
|
|
32
|
+
src: {
|
|
33
|
+
url: 'https://picsum.photos/id/973/1800/1200',
|
|
34
|
+
width: 1800,
|
|
35
|
+
height: 1200
|
|
36
|
+
},
|
|
37
|
+
// lake
|
|
38
|
+
srcSet:
|
|
39
|
+
'https://picsum.photos/id/865/768/548 768w, https://picsum.photos/id/865/1024/684 1024w, https://picsum.photos/id/865/1440/770 1440w, https://picsum.photos/id/865/1800/963 1800w',
|
|
40
|
+
// jungle
|
|
41
|
+
screenMd: {
|
|
42
|
+
url: 'https://picsum.photos/id/921/800/640'
|
|
43
|
+
},
|
|
44
|
+
// desert
|
|
45
|
+
screenSm: {
|
|
46
|
+
url: 'https://picsum.photos/id/247/640/900'
|
|
47
|
+
},
|
|
48
|
+
alt: 'Robotics detail page hero image'
|
|
49
|
+
},
|
|
29
50
|
title: 'Asteroid Watch',
|
|
30
51
|
body: BlockStreamfieldData.body,
|
|
31
52
|
latestAsteroidNews: BlockLinkCardCarouselData
|
|
@@ -39,7 +39,7 @@ export const BaseStory = {
|
|
|
39
39
|
publicationDate: '2012-07-05T20:04:21+00:00',
|
|
40
40
|
title: 'Milky Way',
|
|
41
41
|
topicLabel: 'Stars and Galaxies',
|
|
42
|
-
|
|
42
|
+
descriptionString:
|
|
43
43
|
'<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec lobortis lorem non purus consequat rutrum. Nulla vel convallis urna, eu porta purus. In hendrerit odio id diam volutpat auctor. Curabitur imperdiet dolor ipsum, quis luctus quam hendrerit eu. Quisque gravida lacus velit, a tempor dolor facilisis interdum. Sed pharetra mi eget feugiat bibendum. Donec vel nisi non nisi ultrices pellentesque eget non massa. Proin hendrerit sodales auctor. Phasellus egestas tortor eget ullamcorper tempor. Cras quis mauris erat. Curabitur tempor quam eget tellus aliquam semper. Morbi fringilla sodales dapibus. Proin pellentesque turpis eu neque pretium, in sodales sem auctor.</p>'
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
>
|
|
43
43
|
<div class="lg:grid grid-cols-10">
|
|
44
44
|
<div
|
|
45
|
-
v-if="data.
|
|
45
|
+
v-if="data.descriptionString"
|
|
46
46
|
class="col-span-7"
|
|
47
47
|
>
|
|
48
|
-
<BlockText :text="data.
|
|
48
|
+
<BlockText :text="data.descriptionString" />
|
|
49
49
|
</div>
|
|
50
50
|
<aside class="col-start-9 col-end-11">
|
|
51
51
|
<div class="lg:pt-0 pt-8 mb-12">
|
|
@@ -29,7 +29,7 @@ export const PagePodcastSeasonData = {
|
|
|
29
29
|
summary:
|
|
30
30
|
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas in nibh mauris. Praesent vel tempus enim, a ultricies justo. Cras nec lorem quis lorem ullamcorper accumsan. Aliquam lacus tortor, vulputate sit amet purus vitae, accumsan maximus diam. Vivamus ac dui non sapien hendrerit elementum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis porttitor ac quam sed eleifend.',
|
|
31
31
|
featuredEpisode: HeroMediumData.feature,
|
|
32
|
-
|
|
32
|
+
listingPageHeroImage: {
|
|
33
33
|
// same dimensions used for HeroMedium
|
|
34
34
|
src: {
|
|
35
35
|
url: 'https://picsum.photos/id/247/1800/1200',
|
|
@@ -32,7 +32,7 @@ export const TopicDetailData = {
|
|
|
32
32
|
parentDisplayTitle: 'Solar System Exploration at JPL',
|
|
33
33
|
strapline:
|
|
34
34
|
'Robotic orbiters, landers and mobile laboratories explore Mars and communicate with Earth via the Deep Space Network.',
|
|
35
|
-
|
|
35
|
+
listingPageHeroImage: {
|
|
36
36
|
src: {
|
|
37
37
|
url: 'https://picsum.photos/1800/1200',
|
|
38
38
|
width: 1800,
|
package/src/utils/mixins.ts
CHANGED
|
@@ -307,7 +307,7 @@ export const mixinFormatSplitEventDates = (
|
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
// return event dates formatted for listing cards
|
|
310
|
-
export const mixinFormatEventDates = (startDatetime
|
|
310
|
+
export const mixinFormatEventDates = (startDatetime?: string, endDatetime?: string): string => {
|
|
311
311
|
const startDateDayjs = dayjs(startDatetime)
|
|
312
312
|
|
|
313
313
|
let eventDate = startDateDayjs.format('ll')
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { GradeLevelsObject } from './../interfaces'
|
|
2
|
+
import { computed, ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
const gradesAsNumbers = ref({
|
|
5
|
+
K: 0,
|
|
6
|
+
'1': 1,
|
|
7
|
+
'2': 2,
|
|
8
|
+
'3': 3,
|
|
9
|
+
'4': 4,
|
|
10
|
+
'5': 5,
|
|
11
|
+
'6': 6,
|
|
12
|
+
'7': 7,
|
|
13
|
+
'8': 8,
|
|
14
|
+
'9': 9,
|
|
15
|
+
'10': 10,
|
|
16
|
+
'11': 11,
|
|
17
|
+
'12': 12
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const numbersAsGrades = computed(
|
|
21
|
+
(): {
|
|
22
|
+
[name: number]: string
|
|
23
|
+
} => {
|
|
24
|
+
return Object.keys(gradesAsNumbers.value).reduce((ret, key) => {
|
|
25
|
+
// @ts-expect-error need to correctly retype keys when swapping
|
|
26
|
+
ret[gradesAsNumbers.value[key]] = key
|
|
27
|
+
return ret
|
|
28
|
+
}, {})
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
const rangeify = (a: number[]): string[] => {
|
|
33
|
+
const res: string[] = []
|
|
34
|
+
let run = []
|
|
35
|
+
for (let i = 0; i < a.length; i++) {
|
|
36
|
+
run.push(a[i])
|
|
37
|
+
if (i + 1 >= a.length || a[i + 1] - a[i] > 1) {
|
|
38
|
+
res.push(
|
|
39
|
+
// @ts-expect-error
|
|
40
|
+
run.length > 1
|
|
41
|
+
? `${numbersAsGrades.value[run[0]]}-${run.pop()}`
|
|
42
|
+
: run.map((item) => numbersAsGrades.value[item])
|
|
43
|
+
)
|
|
44
|
+
run = []
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return res
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const rangeifyGrades = (gradeLevels: GradeLevelsObject[]) => {
|
|
51
|
+
if (gradeLevels) {
|
|
52
|
+
const allAgesArray = gradeLevels.map((item) => {
|
|
53
|
+
if (item.gradeLevel === 'All Ages') return item.gradeLevel
|
|
54
|
+
})
|
|
55
|
+
const allAges = allAgesArray.join('')
|
|
56
|
+
|
|
57
|
+
const gradesArray = gradeLevels.map((item) => {
|
|
58
|
+
// @ts-expect-error
|
|
59
|
+
const level: number = gradesAsNumbers.value[item.gradeLevel]
|
|
60
|
+
return level
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
const filteredGrades = rangeify(gradesArray.filter(Number.isFinite))
|
|
64
|
+
let preparedGrades: string = ''
|
|
65
|
+
if (filteredGrades?.length) {
|
|
66
|
+
const gradeString = filteredGrades.length > 1 ? 'Grades: ' : 'Grade: '
|
|
67
|
+
preparedGrades = filteredGrades
|
|
68
|
+
.map((grade, index) => (index === 0 ? gradeString + grade : grade))
|
|
69
|
+
.join(', ')
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const audienceArray = [allAges, preparedGrades]
|
|
73
|
+
return audienceArray.filter(Boolean).join(', ')
|
|
74
|
+
}
|
|
75
|
+
return undefined
|
|
76
|
+
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { Attributes } from './../../interfaces'
|
|
3
|
-
|
|
4
|
-
// using borders to vertically center wonky font face
|
|
5
|
-
const variantMap: Attributes = {
|
|
6
|
-
primary: 'bg-primary border-primary',
|
|
7
|
-
secondary: 'bg-secondary border-secondary',
|
|
8
|
-
action: 'bg-action border-action'
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const sizeMap: Attributes = {
|
|
12
|
-
sm: 'text-xs border-t-2 py-1 px-2.5',
|
|
13
|
-
md: 'text-xs lg:text-base border-t py-1.5 px-3.5',
|
|
14
|
-
lg: 'text-base lg:text-lg border-t pt-1.5 pb-1 px-5'
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface BaseTagProps {
|
|
18
|
-
variant?: string
|
|
19
|
-
size?: string
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// define props
|
|
23
|
-
const props = withDefaults(defineProps<BaseTagProps>(), {
|
|
24
|
-
variant: 'primary',
|
|
25
|
-
size: 'md'
|
|
26
|
-
})
|
|
27
|
-
</script>
|
|
28
|
-
<template>
|
|
29
|
-
<p
|
|
30
|
-
:class="`${variantMap[props.variant]} ${sizeMap[props.size]}`"
|
|
31
|
-
class="ThemeVariantLight text-contrast-none inline-block text-white font-bold edu:font-extrabold rounded-full leading-tight m-0 uppercase print:border-none print:px-0"
|
|
32
|
-
>
|
|
33
|
-
<slot />
|
|
34
|
-
<span class="sr-only">.</span>
|
|
35
|
-
</p>
|
|
36
|
-
</template>
|