@explorer-1/vue 0.2.7 → 0.2.9
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/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/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/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/NavMobile/NavMobile.vue +3 -1
- 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/edu/PageEduEventDetail/PageEduEventDetail.stories.js +4 -3
- package/src/templates/edu/PageEduEventDetail/PageEduEventDetail.vue +38 -123
- package/src/utils/mixins.ts +2 -2
- package/src/utils/rangeifyGrades.ts +76 -0
- package/src/components/BaseTag/BaseTag.vue +0 -36
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import MetadataEduResource from './MetadataEduResource.vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/Utilities/MetadataEduResource',
|
|
5
|
+
component: MetadataEduResource,
|
|
6
|
+
tags: ['!autodocs'],
|
|
7
|
+
argTypes: {
|
|
8
|
+
variant: {
|
|
9
|
+
type: { name: 'string', required: false },
|
|
10
|
+
control: {
|
|
11
|
+
type: 'select',
|
|
12
|
+
options: ['primary', 'secondary']
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
excludeStories: /.*Data$/
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// data
|
|
20
|
+
export const MetadataEduResourceData = {
|
|
21
|
+
resource: {
|
|
22
|
+
title: 'Event title',
|
|
23
|
+
primarySubject: {
|
|
24
|
+
subject: 'Engineering'
|
|
25
|
+
},
|
|
26
|
+
gradeLevels: [
|
|
27
|
+
{
|
|
28
|
+
gradeLevel: 'All Ages'
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
compact: false,
|
|
33
|
+
variant: 'primary'
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const BaseStory = {
|
|
37
|
+
name: 'MetadataEduResource',
|
|
38
|
+
args: { ...MetadataEduResourceData }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const MultipleGradeLevels = {
|
|
42
|
+
args: {
|
|
43
|
+
...MetadataEduResourceData,
|
|
44
|
+
resource: {
|
|
45
|
+
...MetadataEduResourceData.resource,
|
|
46
|
+
gradeLevels: [
|
|
47
|
+
{ gradeLevel: 'All Ages' },
|
|
48
|
+
{ gradeLevel: 'K' },
|
|
49
|
+
{ gradeLevel: '1' },
|
|
50
|
+
{ gradeLevel: '2' },
|
|
51
|
+
{ gradeLevel: '5' },
|
|
52
|
+
{ gradeLevel: '6' },
|
|
53
|
+
{ gradeLevel: '7' },
|
|
54
|
+
{ gradeLevel: '8' }
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
variant: 'secondary'
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import type { EduResourceCardObject } from './../../interfaces.ts'
|
|
4
|
+
import IconSubject from './../Icons/IconSubject.vue'
|
|
5
|
+
import IconProfile from './../Icons/IconProfile.vue'
|
|
6
|
+
// import IconTime from './../Icons/IconTime.vue'
|
|
7
|
+
import {} from './../../utils/mixins'
|
|
8
|
+
import { rangeifyGrades } from './../../utils/rangeifyGrades'
|
|
9
|
+
|
|
10
|
+
interface MetadataEduResourceProps {
|
|
11
|
+
resource: EduResourceCardObject
|
|
12
|
+
compact?: boolean
|
|
13
|
+
variant?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// define props
|
|
17
|
+
const props = withDefaults(defineProps<MetadataEduResourceProps>(), {
|
|
18
|
+
resource: undefined,
|
|
19
|
+
compact: false,
|
|
20
|
+
variant: 'primary'
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
const iconClass = computed(() => {
|
|
24
|
+
return props.variant === 'primary' ? 'text-primary' : 'text-secondary'
|
|
25
|
+
})
|
|
26
|
+
const primarySubject = computed(() => {
|
|
27
|
+
return props.resource?.primarySubject?.subject
|
|
28
|
+
})
|
|
29
|
+
const audience = computed(() => {
|
|
30
|
+
return rangeifyGrades(props.resource?.gradeLevels)
|
|
31
|
+
})
|
|
32
|
+
</script>
|
|
33
|
+
<template>
|
|
34
|
+
<div
|
|
35
|
+
class="MetadataEduResource"
|
|
36
|
+
:class="{ '-compact text-body-sm': props.compact, 'text-body-lg': !props.compact }"
|
|
37
|
+
>
|
|
38
|
+
<div
|
|
39
|
+
v-if="primarySubject"
|
|
40
|
+
class="MetadataEduResourceItem"
|
|
41
|
+
>
|
|
42
|
+
<IconSubject
|
|
43
|
+
class="MetadataEduResourceIcon text-[1.25em]"
|
|
44
|
+
:class="iconClass"
|
|
45
|
+
/>
|
|
46
|
+
<span>
|
|
47
|
+
{{ primarySubject }}
|
|
48
|
+
</span>
|
|
49
|
+
</div>
|
|
50
|
+
<div
|
|
51
|
+
v-if="audience"
|
|
52
|
+
class="MetadataEduResourceItem"
|
|
53
|
+
>
|
|
54
|
+
<IconProfile
|
|
55
|
+
class="MetadataEduResourceIcon text-[1.3em]"
|
|
56
|
+
:class="iconClass"
|
|
57
|
+
/>
|
|
58
|
+
<span>{{ audience }}</span>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
<style lang="scss">
|
|
63
|
+
.MetadataEduResource {
|
|
64
|
+
@apply lg:flex lg:flex-grow;
|
|
65
|
+
.MetadataEduResourceItem {
|
|
66
|
+
@apply flex;
|
|
67
|
+
@apply items-start;
|
|
68
|
+
@apply mr-4 md:mr-4 xl:mr-8;
|
|
69
|
+
@apply mb-5 lg:mb-7;
|
|
70
|
+
@apply lg:min-w-[10rem];
|
|
71
|
+
|
|
72
|
+
span {
|
|
73
|
+
@apply text-gray-dark;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
svg {
|
|
77
|
+
min-width: 1.25rem;
|
|
78
|
+
@apply top-0.5;
|
|
79
|
+
}
|
|
80
|
+
.MetadataEduResourceIcon {
|
|
81
|
+
@apply relative mr-3 lg:mr-2 xl:mr-3;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.-compact {
|
|
86
|
+
@apply flex flex-grow;
|
|
87
|
+
.MetadataEduResourceItem {
|
|
88
|
+
@apply max-w-none min-w-[4em];
|
|
89
|
+
@apply mr-6 mb-0;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import MetadataEvent from './MetadataEvent.vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/Utilities/MetadataEvent',
|
|
5
|
+
component: MetadataEvent,
|
|
6
|
+
tags: ['!autodocs'],
|
|
7
|
+
excludeStories: /.*Data$/
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// data
|
|
11
|
+
export const MetadataEventData = {
|
|
12
|
+
event: {
|
|
13
|
+
title: 'Event title',
|
|
14
|
+
location: 'Location',
|
|
15
|
+
startDate: '2021-11-11',
|
|
16
|
+
startDatetime: '2021-11-11T00:00:00-08:00',
|
|
17
|
+
endDate: '2021-11-11',
|
|
18
|
+
ongoing: false,
|
|
19
|
+
isVirtualEvent: false,
|
|
20
|
+
endDatetime: '2021-11-11T23:59:59.999999-08:00',
|
|
21
|
+
locationName: 'Webcast',
|
|
22
|
+
locationLink: 'https://www.nasa.gov',
|
|
23
|
+
customDate: undefined
|
|
24
|
+
},
|
|
25
|
+
compact: false
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const BaseStory = {
|
|
29
|
+
name: 'MetadataEvent',
|
|
30
|
+
args: MetadataEventData
|
|
31
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { useThemeStore } from '../../store/theme'
|
|
4
|
+
import type { EventCardObject } from './../../interfaces.ts'
|
|
5
|
+
import BaseLink from './../BaseLink/BaseLink.vue'
|
|
6
|
+
import IconCalendar from './../Icons/IconCalendar.vue'
|
|
7
|
+
import IconTime from './../Icons/IconTime.vue'
|
|
8
|
+
import IconLocation from './../Icons/IconLocation.vue'
|
|
9
|
+
import { mixinFormatEventDates, mixinFormatEventTimeInHoursAndMinutes } from './../../utils/mixins'
|
|
10
|
+
const themeStore = useThemeStore()
|
|
11
|
+
|
|
12
|
+
interface MetadataEventProps {
|
|
13
|
+
event: EventCardObject
|
|
14
|
+
compact?: boolean
|
|
15
|
+
allowBreak?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// define props
|
|
19
|
+
const props = withDefaults(defineProps<MetadataEventProps>(), {
|
|
20
|
+
event: undefined,
|
|
21
|
+
compact: false,
|
|
22
|
+
allowBreak: false
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const startDatetimeForFormatting = computed(() => {
|
|
26
|
+
return props.event?.startDatetime || props.event?.startDate
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const formattedEventDates = computed((): string | undefined => {
|
|
30
|
+
return props.event && startDatetimeForFormatting.value
|
|
31
|
+
? mixinFormatEventDates(
|
|
32
|
+
startDatetimeForFormatting.value,
|
|
33
|
+
props.event.endDatetime || props.event.endDate
|
|
34
|
+
)
|
|
35
|
+
: undefined
|
|
36
|
+
})
|
|
37
|
+
const displayTime = computed((): string => {
|
|
38
|
+
if (!props.event.customDate) {
|
|
39
|
+
const time =
|
|
40
|
+
props.event && startDatetimeForFormatting.value
|
|
41
|
+
? mixinFormatEventTimeInHoursAndMinutes(
|
|
42
|
+
startDatetimeForFormatting.value,
|
|
43
|
+
props.event.endDatetime || props.event.endDate,
|
|
44
|
+
props.event.endTime
|
|
45
|
+
)
|
|
46
|
+
: undefined
|
|
47
|
+
return time ? (themeStore.isEdu ? time.replaceAll(':00', '') : time) : ''
|
|
48
|
+
}
|
|
49
|
+
return ''
|
|
50
|
+
})
|
|
51
|
+
const locationName = computed(() => {
|
|
52
|
+
return props.event?.locationName || props.event?.location
|
|
53
|
+
})
|
|
54
|
+
</script>
|
|
55
|
+
<template>
|
|
56
|
+
<div
|
|
57
|
+
class="MetadataEvent"
|
|
58
|
+
:class="{
|
|
59
|
+
'-compact text-body-sm': props.compact,
|
|
60
|
+
'text-body-lg': !props.compact,
|
|
61
|
+
'-allow-break': props.allowBreak
|
|
62
|
+
}"
|
|
63
|
+
>
|
|
64
|
+
<div
|
|
65
|
+
v-if="props.event.ongoing || props.event.customDate || formattedEventDates"
|
|
66
|
+
class="MetadataEventItem"
|
|
67
|
+
>
|
|
68
|
+
<IconCalendar class="MetadataEventIcon text-[1.05em]" />
|
|
69
|
+
<span>{{
|
|
70
|
+
props.event.ongoing ? 'Ongoing' : props.event.customDate || formattedEventDates
|
|
71
|
+
}}</span>
|
|
72
|
+
</div>
|
|
73
|
+
<div
|
|
74
|
+
v-show="displayTime"
|
|
75
|
+
class="MetadataEventItem"
|
|
76
|
+
>
|
|
77
|
+
<IconTime class="MetadataEventIcon text-[1.15em]" />
|
|
78
|
+
<span>{{ displayTime }}</span>
|
|
79
|
+
</div>
|
|
80
|
+
<!--Virtual location -->
|
|
81
|
+
<div
|
|
82
|
+
v-if="props.event.isVirtualEvent && props.event.locationLink && !props.compact"
|
|
83
|
+
itemprop="location"
|
|
84
|
+
itemscope
|
|
85
|
+
itemtype="https://schema.org/VirtualLocation"
|
|
86
|
+
class="MetadataEventItem"
|
|
87
|
+
>
|
|
88
|
+
<link
|
|
89
|
+
itemprop="url"
|
|
90
|
+
:href="props.event.locationLink"
|
|
91
|
+
/>
|
|
92
|
+
<meta
|
|
93
|
+
itemprop="name"
|
|
94
|
+
:content="locationName"
|
|
95
|
+
/>
|
|
96
|
+
<IconLocation class="MetadataEventIcon text-[1.1em]" />
|
|
97
|
+
<BaseLink
|
|
98
|
+
variant="none"
|
|
99
|
+
class="text-action"
|
|
100
|
+
:href="props.event.locationLink"
|
|
101
|
+
external-target-blank
|
|
102
|
+
>
|
|
103
|
+
{{ locationName }}
|
|
104
|
+
</BaseLink>
|
|
105
|
+
</div>
|
|
106
|
+
<!-- Normal location -->
|
|
107
|
+
<div
|
|
108
|
+
v-else-if="locationName"
|
|
109
|
+
class="MetadataEventItem"
|
|
110
|
+
>
|
|
111
|
+
<meta
|
|
112
|
+
v-if="!props.compact"
|
|
113
|
+
itemprop="location"
|
|
114
|
+
:content="locationName"
|
|
115
|
+
/>
|
|
116
|
+
<IconLocation class="MetadataEventIcon text-[1.2em]" />
|
|
117
|
+
<BaseLink
|
|
118
|
+
v-if="props.event.locationLink && !props.compact"
|
|
119
|
+
variant="none"
|
|
120
|
+
class="text-action"
|
|
121
|
+
:href="props.event.locationLink"
|
|
122
|
+
external-target-blank
|
|
123
|
+
>
|
|
124
|
+
{{ locationName }}
|
|
125
|
+
</BaseLink>
|
|
126
|
+
<span v-else>{{ locationName }}</span>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
</template>
|
|
130
|
+
<style lang="scss">
|
|
131
|
+
.MetadataEvent {
|
|
132
|
+
@apply lg:flex lg:flex-grow;
|
|
133
|
+
.MetadataEventItem {
|
|
134
|
+
@apply flex;
|
|
135
|
+
@apply items-start;
|
|
136
|
+
@apply mr-4 md:mr-4 xl:mr-8;
|
|
137
|
+
@apply mb-5 lg:mb-7;
|
|
138
|
+
@apply lg:min-w-[10rem];
|
|
139
|
+
|
|
140
|
+
span {
|
|
141
|
+
@apply text-gray-dark;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
svg {
|
|
145
|
+
min-width: 1.25rem;
|
|
146
|
+
@apply top-0.5;
|
|
147
|
+
}
|
|
148
|
+
.MetadataEventIcon {
|
|
149
|
+
@apply text-primary relative mr-3 lg:mr-2 xl:mr-3;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&.-compact {
|
|
154
|
+
@apply flex flex-grow;
|
|
155
|
+
.MetadataEventItem {
|
|
156
|
+
@apply max-w-none min-w-[4em];
|
|
157
|
+
@apply mr-6 mb-0;
|
|
158
|
+
}
|
|
159
|
+
&.-allow-break {
|
|
160
|
+
@apply block lg:flex;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
</style>
|
|
@@ -295,7 +295,9 @@ export default defineComponent({
|
|
|
295
295
|
// styles for default vs transparent header
|
|
296
296
|
// underline color and logo inversion styles handled within their respective components
|
|
297
297
|
&.-scrolled {
|
|
298
|
-
@
|
|
298
|
+
@media not print {
|
|
299
|
+
@apply fixed;
|
|
300
|
+
}
|
|
299
301
|
}
|
|
300
302
|
}
|
|
301
303
|
// vue-transition classes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import SearchResultCard from './SearchResultCard.vue'
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title: 'Components/
|
|
4
|
+
title: 'Components/Cards/SearchResultCards',
|
|
5
5
|
component: SearchResultCard,
|
|
6
6
|
argTypes: {
|
|
7
7
|
headingLevel: {
|
|
@@ -32,17 +32,16 @@ export const SearchResultCardData = {
|
|
|
32
32
|
},
|
|
33
33
|
alt: 'Alt text'
|
|
34
34
|
},
|
|
35
|
-
headingLevel: 'h3'
|
|
36
|
-
featured: false
|
|
35
|
+
headingLevel: 'h3'
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
export const BaseStory = { name: '
|
|
38
|
+
export const BaseStory = { name: 'SearchResultCard', args: SearchResultCardData }
|
|
40
39
|
|
|
41
40
|
export const FeaturedResult = {
|
|
42
41
|
args: { ...SearchResultCardData, featured: true }
|
|
43
42
|
}
|
|
44
43
|
|
|
45
|
-
export const
|
|
44
|
+
export const EventCard = {
|
|
46
45
|
args: {
|
|
47
46
|
...SearchResultCardData,
|
|
48
47
|
isEvents: true,
|
|
@@ -55,3 +54,21 @@ export const EventResult = {
|
|
|
55
54
|
compact: false
|
|
56
55
|
}
|
|
57
56
|
}
|
|
57
|
+
export const PodcastEpisodeCard = {
|
|
58
|
+
args: {
|
|
59
|
+
...SearchResultCardData,
|
|
60
|
+
isPodcastSeason: true,
|
|
61
|
+
type: 'Podcast',
|
|
62
|
+
compact: false
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const EduEventCard = {
|
|
67
|
+
args: {
|
|
68
|
+
...SearchResultCardData,
|
|
69
|
+
pageContentType: 'eduevents_edueventpage',
|
|
70
|
+
startDate: '2021-11-11',
|
|
71
|
+
endDate: '2021-11-11',
|
|
72
|
+
eventType: 'Internship'
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -1,7 +1,32 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
+
<BlockLinkCard
|
|
4
|
+
v-if="themeStore.isEdu"
|
|
5
|
+
:heading-level="headingLevel"
|
|
6
|
+
size="lg"
|
|
7
|
+
:data="{
|
|
8
|
+
page: {
|
|
9
|
+
__typename: pageContentType
|
|
10
|
+
? (searchContentTypeToPageType[pageContentType] as string)
|
|
11
|
+
: undefined,
|
|
12
|
+
url,
|
|
13
|
+
type,
|
|
14
|
+
label: topic,
|
|
15
|
+
date,
|
|
16
|
+
title,
|
|
17
|
+
summary,
|
|
18
|
+
thumbnailImage: image,
|
|
19
|
+
startTime,
|
|
20
|
+
startDate,
|
|
21
|
+
endTime,
|
|
22
|
+
endDate,
|
|
23
|
+
location,
|
|
24
|
+
eventType: eventType
|
|
25
|
+
}
|
|
26
|
+
}"
|
|
27
|
+
/>
|
|
3
28
|
<EventCard
|
|
4
|
-
v-if="isEvents"
|
|
29
|
+
v-else-if="isEvents"
|
|
5
30
|
:url="url"
|
|
6
31
|
:title="title"
|
|
7
32
|
:summary="summary"
|
|
@@ -170,7 +195,7 @@
|
|
|
170
195
|
:src="image.src.url"
|
|
171
196
|
:width="image.src.width"
|
|
172
197
|
:height="image.src.height"
|
|
173
|
-
:alt="image.alt"
|
|
198
|
+
:alt="image.alt || ''"
|
|
174
199
|
class="object-cover w-full h-full"
|
|
175
200
|
loading="lazy"
|
|
176
201
|
data-chromatic="ignore"
|
|
@@ -184,12 +209,16 @@
|
|
|
184
209
|
<script lang="ts">
|
|
185
210
|
import type { PropType } from 'vue'
|
|
186
211
|
import { defineComponent } from 'vue'
|
|
212
|
+
import { mapStores } from 'pinia'
|
|
213
|
+
import { useThemeStore } from '../../store/theme'
|
|
187
214
|
import PodcastEpisodeCard from './../PodcastEpisodeCard/PodcastEpisodeCard.vue'
|
|
188
215
|
import BaseLink from './../BaseLink/BaseLink.vue'
|
|
189
216
|
import BaseHeading from './../BaseHeading/BaseHeading.vue'
|
|
190
217
|
import BaseImage from './../BaseImage/BaseImage.vue'
|
|
191
218
|
import BaseImagePlaceholder from './../BaseImagePlaceholder/BaseImagePlaceholder.vue'
|
|
192
219
|
import EventCard from './../EventCard/EventCard.vue'
|
|
220
|
+
import BlockLinkCard from './../BlockLinkCard/BlockLinkCard.vue'
|
|
221
|
+
import { searchContentTypeToPageType } from './../../constants'
|
|
193
222
|
import type { HeadingLevel } from './../BaseHeading/BaseHeading.vue'
|
|
194
223
|
|
|
195
224
|
export default defineComponent({
|
|
@@ -200,6 +229,7 @@ export default defineComponent({
|
|
|
200
229
|
BaseImage,
|
|
201
230
|
BaseImagePlaceholder,
|
|
202
231
|
EventCard,
|
|
232
|
+
BlockLinkCard,
|
|
203
233
|
PodcastEpisodeCard
|
|
204
234
|
},
|
|
205
235
|
props: {
|
|
@@ -210,27 +240,38 @@ export default defineComponent({
|
|
|
210
240
|
},
|
|
211
241
|
type: {
|
|
212
242
|
type: String,
|
|
213
|
-
required: false
|
|
243
|
+
required: false,
|
|
244
|
+
default: undefined
|
|
245
|
+
},
|
|
246
|
+
eventType: {
|
|
247
|
+
type: String,
|
|
248
|
+
required: false,
|
|
249
|
+
default: undefined
|
|
214
250
|
},
|
|
215
251
|
topic: {
|
|
216
252
|
type: String,
|
|
217
|
-
required: false
|
|
253
|
+
required: false,
|
|
254
|
+
default: undefined
|
|
218
255
|
},
|
|
219
256
|
date: {
|
|
220
257
|
type: String,
|
|
221
|
-
required: false
|
|
258
|
+
required: false,
|
|
259
|
+
default: undefined
|
|
222
260
|
},
|
|
223
261
|
title: {
|
|
224
262
|
type: String,
|
|
225
|
-
required: false
|
|
263
|
+
required: false,
|
|
264
|
+
default: undefined
|
|
226
265
|
},
|
|
227
266
|
summary: {
|
|
228
267
|
type: String,
|
|
229
|
-
required: false
|
|
268
|
+
required: false,
|
|
269
|
+
default: undefined
|
|
230
270
|
},
|
|
231
271
|
image: {
|
|
232
272
|
type: Object,
|
|
233
|
-
required: false
|
|
273
|
+
required: false,
|
|
274
|
+
default: undefined
|
|
234
275
|
},
|
|
235
276
|
featured: {
|
|
236
277
|
type: Boolean,
|
|
@@ -256,27 +297,43 @@ export default defineComponent({
|
|
|
256
297
|
},
|
|
257
298
|
media: {
|
|
258
299
|
type: String,
|
|
259
|
-
required: false
|
|
300
|
+
required: false,
|
|
301
|
+
default: undefined
|
|
260
302
|
},
|
|
261
303
|
startTime: {
|
|
262
304
|
type: String,
|
|
263
|
-
required: false
|
|
305
|
+
required: false,
|
|
306
|
+
default: undefined
|
|
264
307
|
},
|
|
265
308
|
startDate: {
|
|
266
309
|
type: String,
|
|
267
|
-
required: false
|
|
310
|
+
required: false,
|
|
311
|
+
default: undefined
|
|
268
312
|
},
|
|
269
313
|
endTime: {
|
|
270
314
|
type: String,
|
|
271
|
-
required: false
|
|
315
|
+
required: false,
|
|
316
|
+
default: undefined
|
|
272
317
|
},
|
|
273
318
|
endDate: {
|
|
274
319
|
type: String,
|
|
275
|
-
required: false
|
|
320
|
+
required: false,
|
|
321
|
+
default: undefined
|
|
276
322
|
},
|
|
277
323
|
location: {
|
|
278
324
|
type: String,
|
|
279
|
-
required: false
|
|
325
|
+
required: false,
|
|
326
|
+
default: undefined
|
|
327
|
+
},
|
|
328
|
+
pageContentType: {
|
|
329
|
+
type: String,
|
|
330
|
+
default: undefined
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
computed: {
|
|
334
|
+
...mapStores(useThemeStore),
|
|
335
|
+
searchContentTypeToPageType() {
|
|
336
|
+
return searchContentTypeToPageType
|
|
280
337
|
}
|
|
281
338
|
}
|
|
282
339
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import SearchResultGridItem from './SearchResultGridItem.vue'
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title: 'Components/
|
|
4
|
+
title: 'Components/Cards/SearchResultGridItem',
|
|
5
5
|
component: SearchResultGridItem,
|
|
6
6
|
decorators: [
|
|
7
7
|
() => ({
|
|
@@ -69,3 +69,10 @@ export const MissionResult = {
|
|
|
69
69
|
headingLevel: 'h2'
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
+
export const Event = {
|
|
73
|
+
args: {
|
|
74
|
+
...SearchResultGridCardData.page,
|
|
75
|
+
startTime: '00:00:00-08:00',
|
|
76
|
+
startDate: '2021-11-11'
|
|
77
|
+
}
|
|
78
|
+
}
|