@explorer-1/vue 0.2.67 → 0.2.70
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 +1 -0
- package/dist/explorer-1-vue.js +4815 -4700
- package/dist/explorer-1-vue.umd.cjs +13 -13
- package/dist/src/components/BlockLinkCard/BlockLinkCard.stories.d.ts +68 -0
- package/dist/src/components/BlockLinkCard/BlockLinkCardCollectionLg.vue.d.ts +47 -0
- package/dist/src/components/BlockText/BlockText.stories.d.ts +11 -1
- package/dist/src/components/MetadataEduResource/MetadataEduResource.vue.d.ts +1 -1
- package/dist/src/components/MetadataEvent/MetadataEvent.vue.d.ts +1 -1
- package/dist/src/components/NavJumpMenu/NavJumpMenu.stories.d.ts +15 -2
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/BlockLinkCard/BlockLinkCard.stories.js +115 -0
- package/src/components/BlockLinkCard/BlockLinkCard.vue +180 -145
- package/src/components/BlockLinkCard/BlockLinkCardCollectionLg.vue +132 -0
- package/src/components/BlockRichTable/BlockRichTable.stories.js +94 -0
- package/src/components/BlockRichTable/BlockRichTable.vue +18 -8
- package/src/components/BlockStreamfield/BlockStreamfield.stories.js +40 -0
- package/src/components/MetadataEduResource/MetadataEduResource.vue +1 -1
- package/src/components/NavSearchForm/NavSearchForm.vue +1 -1
- package/src/components/SearchResultCard/SearchResultCard.vue +1 -0
- package/src/components/SearchResultGridItem/SearchResultGridItem.vue +1 -0
- package/src/constants.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@explorer-1/vue",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.70",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"vue-bind-once": "^0.2.1",
|
|
31
31
|
"vue3-compare-image": "^1.2.5",
|
|
32
32
|
"vue3-observe-visibility": "^1.0.1",
|
|
33
|
-
"@explorer-1/common": "1.1.
|
|
33
|
+
"@explorer-1/common": "1.1.19"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
@@ -258,3 +258,118 @@ export const LargeEduExplainerArticle = {
|
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
+
|
|
262
|
+
export const EduCollection = {
|
|
263
|
+
decorators: [
|
|
264
|
+
() => ({
|
|
265
|
+
template: `<div id="storyDecorator" class="relative grid grid-cols-2 gap-3"><story/></div>`
|
|
266
|
+
})
|
|
267
|
+
],
|
|
268
|
+
args: {
|
|
269
|
+
...BlockLinkCardData,
|
|
270
|
+
size: 'sm',
|
|
271
|
+
useFeaturedStyles: true,
|
|
272
|
+
data: {
|
|
273
|
+
page: {
|
|
274
|
+
__typename: 'EDUCollectionsDetailPage',
|
|
275
|
+
...BlockLinkCardData.data,
|
|
276
|
+
summary:
|
|
277
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse mattis auctor magna. Quisque molestie ex metus, et aliquet nunc porttitor nec. Donec imperdiet quam dolor, ut iaculis justo ornare non. Proin finibus nulla ut lorem molestie sagittis quis ut nulla. Sed sit amet dui consectetur, aliquam tortor nec, pulvinar libero.',
|
|
278
|
+
primarySubject: {
|
|
279
|
+
subject: 'Engineering'
|
|
280
|
+
},
|
|
281
|
+
gradeLevels: [
|
|
282
|
+
{ gradeLevel: 'All Ages' },
|
|
283
|
+
{ gradeLevel: 'K' },
|
|
284
|
+
{ gradeLevel: '1' },
|
|
285
|
+
{ gradeLevel: '2' },
|
|
286
|
+
{ gradeLevel: '5' },
|
|
287
|
+
{ gradeLevel: '6' },
|
|
288
|
+
{ gradeLevel: '7' },
|
|
289
|
+
{ gradeLevel: '8' }
|
|
290
|
+
],
|
|
291
|
+
time: {
|
|
292
|
+
time: '1-2 hrs'
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
export const EduCollectionLarge = {
|
|
299
|
+
args: {
|
|
300
|
+
...BlockLinkCardData,
|
|
301
|
+
size: 'lg',
|
|
302
|
+
useFeaturedStyles: true,
|
|
303
|
+
data: {
|
|
304
|
+
page: {
|
|
305
|
+
__typename: 'EDUCollectionsDetailPage',
|
|
306
|
+
...BlockLinkCardData.data,
|
|
307
|
+
summary:
|
|
308
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse mattis auctor magna. Quisque molestie ex metus, et aliquet nunc porttitor nec. Donec imperdiet quam dolor, ut iaculis justo ornare non. Proin finibus nulla ut lorem molestie sagittis quis ut nulla. Sed sit amet dui consectetur, aliquam tortor nec, pulvinar libero.',
|
|
309
|
+
primarySubject: {
|
|
310
|
+
subject: 'Engineering'
|
|
311
|
+
},
|
|
312
|
+
gradeLevels: [
|
|
313
|
+
{ gradeLevel: 'All Ages' },
|
|
314
|
+
{ gradeLevel: 'K' },
|
|
315
|
+
{ gradeLevel: '1' },
|
|
316
|
+
{ gradeLevel: '2' },
|
|
317
|
+
{ gradeLevel: '5' },
|
|
318
|
+
{ gradeLevel: '6' },
|
|
319
|
+
{ gradeLevel: '7' },
|
|
320
|
+
{ gradeLevel: '8' }
|
|
321
|
+
],
|
|
322
|
+
time: {
|
|
323
|
+
time: '1-2 hrs'
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export const EduNewsItem = {
|
|
331
|
+
decorators: [
|
|
332
|
+
() => ({
|
|
333
|
+
template: `<div id="storyDecorator" class="relative grid grid-cols-2 gap-3"><story/></div>`
|
|
334
|
+
})
|
|
335
|
+
],
|
|
336
|
+
args: {
|
|
337
|
+
...BlockLinkCardData,
|
|
338
|
+
data: {
|
|
339
|
+
page: {
|
|
340
|
+
...BlockLinkCardData.data,
|
|
341
|
+
__typename: 'EDUNewsPage'
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
headingLevel: 'h2',
|
|
345
|
+
size: 'sm'
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export const ExternalLink = {
|
|
350
|
+
decorators: [
|
|
351
|
+
() => ({
|
|
352
|
+
template: `<div id="storyDecorator" class="relative grid grid-cols-2 gap-3"><story/></div>`
|
|
353
|
+
})
|
|
354
|
+
],
|
|
355
|
+
args: {
|
|
356
|
+
data: {
|
|
357
|
+
__typename: 'ExternalLinkCardWithDescription',
|
|
358
|
+
externalLink: 'https://nasa.gov',
|
|
359
|
+
title: 'External Link',
|
|
360
|
+
label: 'Dolor Sit',
|
|
361
|
+
summary:
|
|
362
|
+
'Cras rhoncus lorem condimentum tellus rhoncus dictum. Maecenas finibus nibh lorem, quis ornare est vulputate et. Nulla imperdiet ultrices est, ac mattis justo consequat sit amet.',
|
|
363
|
+
thumbnailImage: {
|
|
364
|
+
__typename: 'CustomImage',
|
|
365
|
+
src: {
|
|
366
|
+
__typename: 'CustomRendition',
|
|
367
|
+
url: 'https://picsum.photos/512/288',
|
|
368
|
+
width: '512',
|
|
369
|
+
height: '288'
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
headingLevel: 'h2'
|
|
374
|
+
}
|
|
375
|
+
}
|
|
@@ -1,157 +1,184 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
v-if="
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
external-target-blank
|
|
10
|
-
>
|
|
11
|
-
<BaseImagePlaceholder
|
|
12
|
-
:aspect-ratio="large ? '3:2' : '16:9'"
|
|
13
|
-
class="bg-gray-dark h-full relative overflow-hidden mb-6"
|
|
14
|
-
:class="{ 'lg:mb-10': medium, 'sm:w-1/3 lg:mb-0': large }"
|
|
15
|
-
dark-mode
|
|
16
|
-
no-logo
|
|
17
|
-
>
|
|
18
|
-
<BaseImage
|
|
19
|
-
v-if="theItem.thumbnailImage && theItem.thumbnailImage.src"
|
|
20
|
-
:src="theItem.thumbnailImage.src.url"
|
|
21
|
-
:width="theItem.thumbnailImage.src.width"
|
|
22
|
-
:height="theItem.thumbnailImage.src.height"
|
|
23
|
-
alt=""
|
|
24
|
-
object-fit-class="cover"
|
|
25
|
-
image-class="can-hover:group-hover:delay-200 can-hover:group-hover:scale-100 absolute top-0 left-0 w-full transition-all duration-200 ease-in transform scale-105"
|
|
26
|
-
loading="lazy"
|
|
2
|
+
<div v-if="theItem">
|
|
3
|
+
<template v-if="metadataType === 'EDUCollectionsDetailPage' && useFeaturedStyles">
|
|
4
|
+
<BlockLinkCardCollectionLg
|
|
5
|
+
:the-item="theItem as EduResourceCardObject"
|
|
6
|
+
:metadata-type="metadataType"
|
|
7
|
+
:metadata-attrs="metadataAttrs"
|
|
8
|
+
:size="size"
|
|
27
9
|
/>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
:
|
|
37
|
-
|
|
38
|
-
/>
|
|
39
|
-
</BaseImagePlaceholder>
|
|
40
|
-
|
|
41
|
-
<div
|
|
42
|
-
class="BlockLinkCard__CardContent transition-translate can-hover:group-hover:delay-200 duration-200 ease-in transform ThemeVariantLight"
|
|
43
|
-
:class="contentClasses"
|
|
44
|
-
>
|
|
45
|
-
<template v-if="metadataAttrs">
|
|
46
|
-
<BasePill
|
|
47
|
-
:class="{ 'mb-2': !large, 'mb-4': large }"
|
|
48
|
-
size="sm"
|
|
49
|
-
:content-type="metadataType"
|
|
50
|
-
:text="(theItem as EventCardObject).eventType"
|
|
51
|
-
/>
|
|
52
|
-
</template>
|
|
53
|
-
<template
|
|
54
|
-
v-else-if="themeStore.isEdu && theItem.parent?.title && theItem.parent?.title !== 'EDU'"
|
|
10
|
+
</template>
|
|
11
|
+
<template v-else>
|
|
12
|
+
<BaseLink
|
|
13
|
+
v-if="theItem"
|
|
14
|
+
variant="none"
|
|
15
|
+
:to="theItem.url ? theItem.url : undefined"
|
|
16
|
+
:href="theItem.externalLink ? theItem.externalLink : undefined"
|
|
17
|
+
class="BlockLinkCard group"
|
|
18
|
+
:link-class="`block ${small ? 'pb-3' : 'pb-5'} ${large ? 'sm:flex flex-row border-b border-gray-light-mid pb-5 mb-5' : ''}`"
|
|
19
|
+
external-target-blank
|
|
55
20
|
>
|
|
56
|
-
<
|
|
21
|
+
<BaseImagePlaceholder
|
|
22
|
+
:aspect-ratio="large ? '3:2' : '16:9'"
|
|
23
|
+
class="bg-gray-dark h-full relative overflow-hidden mb-6"
|
|
24
|
+
:class="{ 'lg:mb-10': medium, 'sm:w-1/3 lg:mb-0': large }"
|
|
25
|
+
dark-mode
|
|
26
|
+
no-logo
|
|
27
|
+
>
|
|
28
|
+
<BaseImage
|
|
29
|
+
v-if="theItem.thumbnailImage && theItem.thumbnailImage.src"
|
|
30
|
+
:src="theItem.thumbnailImage.src.url"
|
|
31
|
+
:width="theItem.thumbnailImage.src.width"
|
|
32
|
+
:height="theItem.thumbnailImage.src.height"
|
|
33
|
+
alt=""
|
|
34
|
+
object-fit-class="cover"
|
|
35
|
+
image-class="can-hover:group-hover:delay-200 can-hover:group-hover:scale-100 absolute top-0 left-0 w-full transition-all duration-200 ease-in transform scale-105"
|
|
36
|
+
loading="lazy"
|
|
37
|
+
/>
|
|
38
|
+
<div v-else></div>
|
|
39
|
+
<CalendarChip
|
|
40
|
+
v-if="
|
|
41
|
+
showCalendarChip &&
|
|
42
|
+
themeStore.isEdu &&
|
|
43
|
+
((theItem as EventCardObject).startDate || (theItem as EventCardObject).ongoing)
|
|
44
|
+
"
|
|
45
|
+
:start-date="(theItem as EventCardObject).startDate"
|
|
46
|
+
:end-date="(theItem as EventCardObject).endDate"
|
|
47
|
+
:ongoing="(theItem as EventCardObject).ongoing"
|
|
48
|
+
/>
|
|
49
|
+
</BaseImagePlaceholder>
|
|
50
|
+
|
|
51
|
+
<div
|
|
52
|
+
class="BlockLinkCard__CardContent transition-translate can-hover:group-hover:delay-200 duration-200 ease-in transform ThemeVariantLight"
|
|
53
|
+
:class="contentClasses"
|
|
54
|
+
>
|
|
55
|
+
<template v-if="metadataAttrs">
|
|
56
|
+
<BasePill
|
|
57
|
+
:class="{ 'mb-2': !large, 'mb-4': large }"
|
|
58
|
+
size="sm"
|
|
59
|
+
:content-type="metadataType"
|
|
60
|
+
:text="(theItem as EventCardObject).eventType"
|
|
61
|
+
/>
|
|
62
|
+
<template v-if="metadataType === 'EDUNewsPage' && theItem.label">
|
|
63
|
+
<!-- include the topic label for EDU News -->
|
|
64
|
+
<span class="text-subtitle text-gray-mid-dark uppercase ThemeVariantLight pl-3">
|
|
65
|
+
{{ theItem.label }}
|
|
66
|
+
</span>
|
|
67
|
+
</template>
|
|
68
|
+
</template>
|
|
69
|
+
<template
|
|
70
|
+
v-else-if="themeStore.isEdu && theItem.parent?.title && theItem.parent?.title !== 'EDU'"
|
|
71
|
+
>
|
|
72
|
+
<!-- use parent page's title as the label for EDU Content cards, unless the EDU homepage is the parent -->
|
|
73
|
+
<div class="flex flex-wrap">
|
|
74
|
+
<p
|
|
75
|
+
class="text-subtitle"
|
|
76
|
+
:class="small ? 'mb-2' : 'mb-4'"
|
|
77
|
+
>
|
|
78
|
+
<span class="edu:text-primary ThemeVariantLight">
|
|
79
|
+
{{ (theItem as Card).parent?.title }}
|
|
80
|
+
</span>
|
|
81
|
+
</p>
|
|
82
|
+
</div>
|
|
83
|
+
</template>
|
|
84
|
+
<template v-else>
|
|
85
|
+
<div class="flex flex-wrap">
|
|
86
|
+
<p
|
|
87
|
+
v-if="
|
|
88
|
+
theItem.label || ((theItem as EventCardObject).startDate && !themeStore.isEdu)
|
|
89
|
+
"
|
|
90
|
+
class="text-subtitle divide-gray-mid flex divide-x"
|
|
91
|
+
:class="small ? 'mb-2' : 'mb-4'"
|
|
92
|
+
>
|
|
93
|
+
<span
|
|
94
|
+
v-if="theItem.label"
|
|
95
|
+
class="edu:text-primary ThemeVariantLight"
|
|
96
|
+
:class="{ 'pr-2': (theItem as EventCardObject).startDate && !themeStore.isEdu }"
|
|
97
|
+
>
|
|
98
|
+
{{ theItem.label }}
|
|
99
|
+
</span>
|
|
100
|
+
<span
|
|
101
|
+
v-if="(theItem as EventCardObject).startDate && !themeStore.isEdu"
|
|
102
|
+
:class="{ 'text-gray-mid-dark pl-2': theItem.label }"
|
|
103
|
+
>
|
|
104
|
+
{{ formattedEventDates }}
|
|
105
|
+
</span>
|
|
106
|
+
<span class="sr-only">.</span>
|
|
107
|
+
</p>
|
|
108
|
+
<template v-if="theItem.externalLink">
|
|
109
|
+
<IconExternal
|
|
110
|
+
class="text-primary ml-2"
|
|
111
|
+
:class="{ 'text-sm mt-1px': small, '-mt-1px': medium, '-mt-.5': large }"
|
|
112
|
+
/>
|
|
113
|
+
</template>
|
|
114
|
+
</div>
|
|
115
|
+
</template>
|
|
116
|
+
|
|
117
|
+
<component
|
|
118
|
+
:is="headingLevel || 'p'"
|
|
119
|
+
class="text-gray-dark text-xl font-medium leading-tight tracking-tight edu:font-extrabold"
|
|
120
|
+
:class="{ 'lg:text-3xl': !small }"
|
|
121
|
+
>
|
|
122
|
+
{{ theItem.title }}
|
|
123
|
+
</component>
|
|
57
124
|
<p
|
|
58
|
-
|
|
59
|
-
:class="
|
|
125
|
+
v-if="(theItem as EventCardObject).targetAudience"
|
|
126
|
+
:class="{ 'mt-1': !large, 'mt-4': large }"
|
|
60
127
|
>
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
128
|
+
<strong>Target Audience:</strong> {{ (theItem as EventCardObject).targetAudience }}
|
|
129
|
+
</p>
|
|
130
|
+
<p
|
|
131
|
+
v-if="theItem.date && !themeStore.isEdu"
|
|
132
|
+
class="text-gray-mid-dark"
|
|
133
|
+
:class="{ 'mt-2': !large, 'mt-4': large }"
|
|
134
|
+
>
|
|
135
|
+
{{ theItem.date }}
|
|
136
|
+
</p>
|
|
137
|
+
<p
|
|
138
|
+
v-if="large && theItem.summary"
|
|
139
|
+
class="mt-4 text-gray-mid-dark"
|
|
140
|
+
:class="{
|
|
141
|
+
'line-clamp-2 sm:line-clamp-1 lg:line-clamp-2 xl:line-clamp-3': themeStore.isEdu
|
|
142
|
+
}"
|
|
143
|
+
>
|
|
144
|
+
{{ theItem.summary }}
|
|
64
145
|
</p>
|
|
65
|
-
</div>
|
|
66
|
-
</template>
|
|
67
|
-
<template v-else>
|
|
68
|
-
<div class="flex flex-wrap">
|
|
69
146
|
<p
|
|
70
|
-
v-if="theItem.
|
|
71
|
-
class="text-
|
|
72
|
-
:class="
|
|
147
|
+
v-if="theItem.date && themeStore.isEdu"
|
|
148
|
+
class="text-gray-mid-dark"
|
|
149
|
+
:class="{ 'mt-2': !large, 'mt-4': large }"
|
|
73
150
|
>
|
|
74
|
-
|
|
75
|
-
v-if="theItem.label"
|
|
76
|
-
class="edu:text-primary ThemeVariantLight"
|
|
77
|
-
:class="{ 'pr-2': (theItem as EventCardObject).startDate && !themeStore.isEdu }"
|
|
78
|
-
>
|
|
79
|
-
{{ theItem.label }}
|
|
80
|
-
</span>
|
|
81
|
-
<span
|
|
82
|
-
v-if="(theItem as EventCardObject).startDate && !themeStore.isEdu"
|
|
83
|
-
:class="{ 'text-gray-mid-dark pl-2': theItem.label }"
|
|
84
|
-
>
|
|
85
|
-
{{ formattedEventDates }}
|
|
86
|
-
</span>
|
|
87
|
-
<span class="sr-only">.</span>
|
|
151
|
+
{{ theItem.date }}
|
|
88
152
|
</p>
|
|
153
|
+
<div
|
|
154
|
+
v-if="metadataAttrs"
|
|
155
|
+
:class="{ 'mt-4': large, 'mt-2 mb-1': medium, 'mt-1 mb-0': small }"
|
|
156
|
+
>
|
|
157
|
+
<MetadataEvent
|
|
158
|
+
v-if="metadataType === 'EDUEventPage'"
|
|
159
|
+
:event="theItem"
|
|
160
|
+
:show-time="large"
|
|
161
|
+
compact
|
|
162
|
+
/>
|
|
163
|
+
<MetadataEduResource
|
|
164
|
+
v-else-if="metadataAttrs.type === 'resource'"
|
|
165
|
+
:resource="theItem as EduResourceCardObject"
|
|
166
|
+
:variant="metadataAttrs.icons"
|
|
167
|
+
:show-time="true"
|
|
168
|
+
compact
|
|
169
|
+
/>
|
|
170
|
+
</div>
|
|
89
171
|
</div>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
v-if="(theItem as EventCardObject).targetAudience"
|
|
101
|
-
:class="{ 'mt-1': !large, 'mt-4': large }"
|
|
102
|
-
>
|
|
103
|
-
<strong>Target Audience:</strong> {{ (theItem as EventCardObject).targetAudience }}
|
|
104
|
-
</p>
|
|
105
|
-
<p
|
|
106
|
-
v-if="theItem.date && !themeStore.isEdu"
|
|
107
|
-
class="text-gray-mid-dark"
|
|
108
|
-
:class="{ 'mt-2': !large, 'mt-4': large }"
|
|
109
|
-
>
|
|
110
|
-
{{ theItem.date }}
|
|
111
|
-
</p>
|
|
112
|
-
<p
|
|
113
|
-
v-if="large && theItem.summary"
|
|
114
|
-
class="mt-4 text-gray-mid-dark"
|
|
115
|
-
:class="{
|
|
116
|
-
'line-clamp-2 sm:line-clamp-1 lg:line-clamp-2 xl:line-clamp-3': themeStore.isEdu
|
|
117
|
-
}"
|
|
118
|
-
>
|
|
119
|
-
{{ theItem.summary }}
|
|
120
|
-
</p>
|
|
121
|
-
<p
|
|
122
|
-
v-if="theItem.date && themeStore.isEdu"
|
|
123
|
-
class="text-gray-mid-dark mt-2"
|
|
124
|
-
:class="{ 'mt-2': !large, 'mt-4': large }"
|
|
125
|
-
>
|
|
126
|
-
{{ theItem.date }}
|
|
127
|
-
</p>
|
|
128
|
-
<div
|
|
129
|
-
v-if="metadataAttrs"
|
|
130
|
-
:class="{ 'mt-4': large, 'mt-2 mb-1': medium, 'mt-1 mb-0': small }"
|
|
131
|
-
>
|
|
132
|
-
<MetadataEvent
|
|
133
|
-
v-if="metadataType === 'EDUEventPage'"
|
|
134
|
-
:event="theItem"
|
|
135
|
-
:show-time="large"
|
|
136
|
-
compact
|
|
137
|
-
/>
|
|
138
|
-
<MetadataEduResource
|
|
139
|
-
v-else-if="metadataAttrs.type === 'resource'"
|
|
140
|
-
:resource="theItem as EduResourceCardObject"
|
|
141
|
-
:variant="metadataAttrs.icons"
|
|
142
|
-
:show-time="true"
|
|
143
|
-
compact
|
|
144
|
-
/>
|
|
145
|
-
</div>
|
|
146
|
-
</div>
|
|
147
|
-
<div
|
|
148
|
-
v-if="!large"
|
|
149
|
-
class="BlockLinkCard__CardArrow ThemeVariantLight can-hover:block can-hover:-ml-3 can-hover:group-hover:delay-200 can-hover:opacity-0 can-hover:group-hover:ml-0 can-hover:group-hover:opacity-100 hidden -mt-1 text-2xl leading-normal transition-all duration-200 ease-in"
|
|
150
|
-
:class="metadataAttrs ? `text-${metadataAttrs.icons}` : 'text-primary'"
|
|
151
|
-
>
|
|
152
|
-
<IconArrow />
|
|
153
|
-
</div>
|
|
154
|
-
</BaseLink>
|
|
172
|
+
<div
|
|
173
|
+
v-if="!large"
|
|
174
|
+
class="BlockLinkCard__CardArrow ThemeVariantLight can-hover:block can-hover:-ml-3 can-hover:group-hover:delay-200 can-hover:opacity-0 can-hover:group-hover:ml-0 can-hover:group-hover:opacity-100 hidden -mt-1 text-2xl leading-normal transition-all duration-200 ease-in"
|
|
175
|
+
:class="metadataAttrs ? `text-${metadataAttrs.icons}` : 'text-primary'"
|
|
176
|
+
>
|
|
177
|
+
<IconArrow />
|
|
178
|
+
</div>
|
|
179
|
+
</BaseLink>
|
|
180
|
+
</template>
|
|
181
|
+
</div>
|
|
155
182
|
</template>
|
|
156
183
|
|
|
157
184
|
<script lang="ts">
|
|
@@ -163,10 +190,12 @@ import { useThemeStore } from '../../store/theme'
|
|
|
163
190
|
import { mixinFormatEventDates } from './../../utils/mixins'
|
|
164
191
|
import type { HeadingLevel } from './../BaseHeading/BaseHeading.vue'
|
|
165
192
|
import IconArrow from './../Icons/IconArrow.vue'
|
|
193
|
+
import IconExternal from './../Icons/IconExternal.vue'
|
|
166
194
|
import BaseLink from './../BaseLink/BaseLink.vue'
|
|
167
195
|
import BaseImage from './../BaseImage/BaseImage.vue'
|
|
168
196
|
import BaseImagePlaceholder from './../BaseImagePlaceholder/BaseImagePlaceholder.vue'
|
|
169
197
|
import BasePill from './../BasePill/BasePill.vue'
|
|
198
|
+
import BlockLinkCardCollectionLg from './../BlockLinkCard/BlockLinkCardCollectionLg.vue'
|
|
170
199
|
import CalendarChip from './../CalendarChip/CalendarChip.vue'
|
|
171
200
|
import MetadataEvent from './../MetadataEvent/MetadataEvent.vue'
|
|
172
201
|
import MetadataEduResource from './../MetadataEduResource/MetadataEduResource.vue'
|
|
@@ -176,13 +205,15 @@ export default defineComponent({
|
|
|
176
205
|
name: 'BlockLinkCard',
|
|
177
206
|
components: {
|
|
178
207
|
IconArrow,
|
|
208
|
+
IconExternal,
|
|
179
209
|
BaseLink,
|
|
180
210
|
BaseImage,
|
|
181
211
|
BaseImagePlaceholder,
|
|
182
212
|
BasePill,
|
|
183
213
|
CalendarChip,
|
|
184
214
|
MetadataEvent,
|
|
185
|
-
MetadataEduResource
|
|
215
|
+
MetadataEduResource,
|
|
216
|
+
BlockLinkCardCollectionLg
|
|
186
217
|
},
|
|
187
218
|
props: {
|
|
188
219
|
data: {
|
|
@@ -266,6 +297,10 @@ export default defineComponent({
|
|
|
266
297
|
showCalendarChip: {
|
|
267
298
|
type: Boolean,
|
|
268
299
|
default: false
|
|
300
|
+
},
|
|
301
|
+
useFeaturedStyles: {
|
|
302
|
+
type: Boolean,
|
|
303
|
+
default: false
|
|
269
304
|
}
|
|
270
305
|
},
|
|
271
306
|
computed: {
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, reactive } from 'vue'
|
|
3
|
+
import type { EduResourceCardObject } from '../../interfaces'
|
|
4
|
+
import type { HeadingLevel } from './../BaseHeading/BaseHeading.vue'
|
|
5
|
+
import BaseLink from './../BaseLink/BaseLink.vue'
|
|
6
|
+
import BaseImage from './../BaseImage/BaseImage.vue'
|
|
7
|
+
import BaseImagePlaceholder from './../BaseImagePlaceholder/BaseImagePlaceholder.vue'
|
|
8
|
+
import BasePill from './../BasePill/BasePill.vue'
|
|
9
|
+
import MetadataEduResource from './../MetadataEduResource/MetadataEduResource.vue'
|
|
10
|
+
|
|
11
|
+
interface BlockLinkCardCollectionLgProps {
|
|
12
|
+
theItem?: EduResourceCardObject
|
|
13
|
+
metadataType?: string
|
|
14
|
+
metadataAttrs?: any
|
|
15
|
+
headingLevel?: HeadingLevel
|
|
16
|
+
size?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// define props
|
|
20
|
+
const props = withDefaults(defineProps<BlockLinkCardCollectionLgProps>(), {
|
|
21
|
+
theItem: undefined,
|
|
22
|
+
metadataType: undefined,
|
|
23
|
+
metadataAttrs: undefined,
|
|
24
|
+
headingLevel: undefined,
|
|
25
|
+
size: undefined
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const { theItem, metadataType, metadataAttrs, headingLevel, size } = reactive(props)
|
|
29
|
+
|
|
30
|
+
const isSmall = computed(() => {
|
|
31
|
+
return size === 'sm'
|
|
32
|
+
})
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<BaseLink
|
|
37
|
+
v-if="theItem"
|
|
38
|
+
variant="none"
|
|
39
|
+
:to="theItem.url ? theItem.url : undefined"
|
|
40
|
+
:href="theItem.externalLink ? theItem.externalLink : undefined"
|
|
41
|
+
class="BlockLinkCardCollectionLg group bg-stars bg-primary-dark"
|
|
42
|
+
:link-class="`block mb-8 relative ${isSmall ? 'flex flex-col' : 'sm:flex flex-row'}`"
|
|
43
|
+
external-target-blank
|
|
44
|
+
>
|
|
45
|
+
<BaseImagePlaceholder
|
|
46
|
+
class="bg-gray-dark h-full relative overflow-hidden mb-6 z-20"
|
|
47
|
+
:class="{
|
|
48
|
+
'aspect-ratio-sixteen-nine': isSmall,
|
|
49
|
+
'sm:absolute sm:top-0 sm:right-0 sm:bottom:0 sm:w-1/3 lg:mb-0 order-1 sm:order-2 aspect-ratio-three-two sm:aspect-ratio-one-one':
|
|
50
|
+
!isSmall
|
|
51
|
+
}"
|
|
52
|
+
dark-mode
|
|
53
|
+
no-logo
|
|
54
|
+
>
|
|
55
|
+
<BaseImage
|
|
56
|
+
v-if="theItem.thumbnailImage && theItem.thumbnailImage.src"
|
|
57
|
+
:src="theItem.thumbnailImage.src.url"
|
|
58
|
+
:width="theItem.thumbnailImage.src.width"
|
|
59
|
+
:height="theItem.thumbnailImage.src.height"
|
|
60
|
+
alt=""
|
|
61
|
+
object-fit-class="cover"
|
|
62
|
+
image-class="can-hover:group-hover:delay-200 can-hover:group-hover:scale-[101%] absolute top-0 right-0 w-full transition-all duration-200 ease-in transform scale-105"
|
|
63
|
+
loading="lazy"
|
|
64
|
+
/>
|
|
65
|
+
<div v-else></div>
|
|
66
|
+
</BaseImagePlaceholder>
|
|
67
|
+
<div
|
|
68
|
+
class="BlockLinkCard__CardContent can-hover:group-hover:delay-200 ThemeVariantLight"
|
|
69
|
+
:class="{
|
|
70
|
+
'px-4 pb-4': isSmall,
|
|
71
|
+
'px-6 pb-6 sm:pt-6 lg:px-12 lg:py-10 sm:w-2/3 order-2 sm:order-1': !isSmall
|
|
72
|
+
}"
|
|
73
|
+
>
|
|
74
|
+
<div
|
|
75
|
+
class="absolute z-0 inset-0 bg-gradient-to-r from-transparent-black-75 to-transparent"
|
|
76
|
+
></div>
|
|
77
|
+
<div class="relative z-10">
|
|
78
|
+
<template v-if="metadataAttrs">
|
|
79
|
+
<BasePill
|
|
80
|
+
:class="{
|
|
81
|
+
'mb-2': isSmall,
|
|
82
|
+
'mb-4': !isSmall
|
|
83
|
+
}"
|
|
84
|
+
size="sm"
|
|
85
|
+
:content-type="metadataType"
|
|
86
|
+
/>
|
|
87
|
+
</template>
|
|
88
|
+
|
|
89
|
+
<component
|
|
90
|
+
:is="headingLevel || 'p'"
|
|
91
|
+
class="text-white text-xl font-medium leading-tight tracking-tight edu:font-extrabold"
|
|
92
|
+
:class="{
|
|
93
|
+
'lg:text-3xl': !isSmall
|
|
94
|
+
}"
|
|
95
|
+
>
|
|
96
|
+
{{ theItem.title }}
|
|
97
|
+
</component>
|
|
98
|
+
<p
|
|
99
|
+
v-if="theItem.summary && !isSmall"
|
|
100
|
+
class="mt-4 text-white line-clamp-2 sm:line-clamp-1 lg:line-clamp-2 xl:line-clamp-3"
|
|
101
|
+
>
|
|
102
|
+
{{ theItem.summary }}
|
|
103
|
+
</p>
|
|
104
|
+
<div
|
|
105
|
+
v-if="metadataAttrs"
|
|
106
|
+
:class="{
|
|
107
|
+
'mt-1': isSmall,
|
|
108
|
+
'mt-4': !isSmall
|
|
109
|
+
}"
|
|
110
|
+
>
|
|
111
|
+
<MetadataEduResource
|
|
112
|
+
:resource="theItem"
|
|
113
|
+
:variant="metadataAttrs.icons"
|
|
114
|
+
compact
|
|
115
|
+
/>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</BaseLink>
|
|
120
|
+
</template>
|
|
121
|
+
<style lang="scss">
|
|
122
|
+
.BlockLinkCardCollectionLg {
|
|
123
|
+
.MetadataEduResource .MetadataEduResourceItem {
|
|
124
|
+
.MetadataEduResourceIcon {
|
|
125
|
+
@apply text-white;
|
|
126
|
+
}
|
|
127
|
+
span {
|
|
128
|
+
@apply text-white;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
</style>
|