@explorer-1/vue 0.2.15 → 0.2.17
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 +7 -0
- package/dist/explorer-1-vue.js +2415 -2405
- package/dist/explorer-1-vue.umd.cjs +12 -12
- package/dist/src/components/BaseAccordionItem/BaseAccordionItem.stories.d.ts +99 -0
- package/dist/src/components/BaseButton/BaseButton.stories.d.ts +13 -0
- package/dist/src/components/BaseButton/BaseButton.vue.d.ts +15 -1
- package/dist/src/components/BaseImage/BaseImage.vue.d.ts +1 -1
- package/dist/src/components/BaseImagePlaceholder/BaseImagePlaceholder.vue.d.ts +1 -1
- package/dist/src/components/BaseLink/BaseLink.vue.d.ts +1 -1
- package/dist/src/components/BaseModal/BaseModal.stories.d.ts +26 -0
- package/dist/src/components/BaseSwimlane/BaseSwimlane.vue.d.ts +2 -2
- package/dist/src/components/BaseTimer/BaseTimer.vue.d.ts +2 -2
- package/dist/src/components/BlockAccordion/BlockAccordion.stories.d.ts +98 -0
- package/dist/src/components/BlockHeading/BlockHeading.stories.d.ts +1 -0
- package/dist/src/components/BlockHeading/BlockHeading.vue.d.ts +13 -11
- package/dist/src/components/BlockLinkCard/BlockLinkCard.vue.d.ts +1 -1
- package/dist/src/components/BlockLinkCarousel/BlockLinkCarousel.vue.d.ts +1 -1
- package/dist/src/components/BlockRelatedLinks/RelatedLink.vue.d.ts +1 -1
- package/dist/src/components/BlockStreamfield/BlockStreamfield.stories.d.ts +75 -40
- package/dist/src/components/BlockStreamfield/BlockStreamfield.vue.d.ts +2 -19
- package/dist/src/components/BlockText/BlockText.vue.d.ts +1 -1
- package/dist/src/components/HeroMedia/HeroMedia.vue.d.ts +7 -0
- package/dist/src/components/LayoutHelper/LayoutHelper.vue.d.ts +1 -1
- package/dist/src/components/MetaPanel/MetaPanel.stories.d.ts +51 -0
- package/dist/src/components/MetaPanelItems/MetaPanelItems.stories.d.ts +25 -0
- package/dist/src/components/MetadataEduResource/MetadataEduResource.stories.d.ts +1 -1
- package/dist/src/components/MixinCarousel/MixinCarousel.vue.d.ts +2 -2
- package/dist/src/components/NavSecondary/NavSecondary.vue.d.ts +4 -0
- package/dist/src/interfaces.d.ts +84 -7
- package/dist/src/templates/PageContent/PageContent.stories.d.ts +6 -5
- package/dist/src/templates/PageImageDetail/PageImageDetail.stories.d.ts +43 -16
- package/dist/src/templates/PageNewsDetail/PageNewsDetail.stories.d.ts +344 -128
- package/dist/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.stories.d.ts +44 -16
- package/dist/src/templates/edu/PageEduLesson/PageEduLesson.stories.d.ts +544 -0
- package/dist/src/templates/edu/PageEduNewsDetail/PageEduNewsDetail.stories.d.ts +67 -63
- package/dist/src/templates/www/PageAsteroidWatchIndex/PageAsteroidWatchIndex.stories.d.ts +22 -21
- package/dist/src/templates/www/PageCuratedGallery/PageCuratedGallery.stories.d.ts +43 -16
- package/dist/src/templates/www/PageRoboticsDetail/PageRoboticsDetail.stories.d.ts +43 -16
- package/dist/src/utils/getHeadingId.d.ts +3 -1
- package/dist/style.css +1 -1
- package/package.json +3 -2
- package/src/components/BaseAccordionItem/BaseAccordionItem.stories.js +15 -0
- package/src/components/BaseAccordionItem/BaseAccordionItem.vue +108 -0
- package/src/components/BaseButton/BaseButton.vue +12 -1
- package/src/components/BaseImage/BaseImage.vue +1 -1
- package/src/components/BaseImagePlaceholder/BaseImagePlaceholder.vue +1 -1
- package/src/components/BaseLink/BaseLink.vue +1 -1
- package/src/components/BlockAccordion/BlockAccordion.stories.js +29 -0
- package/src/components/BlockAccordion/BlockAccordion.vue +32 -0
- package/src/components/BlockHeading/BlockHeading.stories.js +2 -2
- package/src/components/BlockHeading/BlockHeading.vue +15 -7
- package/src/components/BlockLinkCarousel/BlockLinkCarousel.vue +1 -1
- package/src/components/BlockRelatedLinks/RelatedLink.vue +1 -1
- package/src/components/BlockStreamfield/BlockStreamfield.stories.js +23 -5
- package/src/components/BlockStreamfield/BlockStreamfield.vue +8 -26
- package/src/components/BlockText/BlockText.vue +1 -1
- package/src/components/HeroMedia/HeroMedia.vue +10 -1
- package/src/components/LayoutHelper/LayoutHelper.vue +1 -1
- package/src/components/MetaPanel/MetaPanel.stories.js +112 -0
- package/src/components/MetaPanel/MetaPanel.vue +237 -0
- package/src/components/MetaPanelAccordion/MetaPanelAccordion.vue +64 -0
- package/src/components/MetaPanelItems/MetaPanelItems.stories.js +27 -0
- package/src/components/MetaPanelItems/MetaPanelItems.vue +186 -0
- package/src/components/MetadataEduResource/MetadataEduResource.stories.js +2 -4
- package/src/components/MixinCarousel/MixinCarousel.vue +2 -2
- package/src/components/NavJumpMenu/NavJumpMenu.vue +10 -8
- package/src/components/NavSecondary/NavSecondary.vue +26 -15
- package/src/components/ShareButtonsEdu/ShareButtonsEdu.vue +1 -1
- package/src/interfaces.ts +91 -8
- package/src/main.ts +2 -0
- package/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.stories.js +1 -0
- package/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.vue +10 -1
- package/src/templates/edu/PageEduLesson/PageEduLesson.stories.js +303 -0
- package/src/templates/edu/PageEduLesson/PageEduLesson.vue +410 -0
- package/src/templates/edu/PageEduLesson/PageEduLessonSection.vue +98 -0
- package/src/templates/edu/PageEduNewsDetail/PageEduNewsDetail.stories.js +1 -0
- package/src/templates/edu/PageEduNewsDetail/PageEduNewsDetail.vue +4 -21
- package/src/utils/getHeadingId.ts +3 -3
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, reactive, ref } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
MetaPanelTheme,
|
|
5
|
+
EduResourcesGradeLevel,
|
|
6
|
+
EduResourceStandardItem,
|
|
7
|
+
EduResourcesSubject,
|
|
8
|
+
EduResourcesTime
|
|
9
|
+
} from './../../interfaces'
|
|
10
|
+
import MetaPanelAccordion from './../MetaPanelAccordion/MetaPanelAccordion.vue'
|
|
11
|
+
import MetaPanelItems from './../MetaPanelItems/MetaPanelItems.vue'
|
|
12
|
+
import IconMinus from './../Icons/IconMinus.vue'
|
|
13
|
+
import IconPlus from './../Icons/IconPlus.vue'
|
|
14
|
+
import BaseButton from './../BaseButton/BaseButton.vue'
|
|
15
|
+
|
|
16
|
+
interface MetaPanelProps {
|
|
17
|
+
button?: string
|
|
18
|
+
theme?: MetaPanelTheme
|
|
19
|
+
primarySubject?: EduResourcesSubject
|
|
20
|
+
additionalSubjects?: EduResourcesSubject[]
|
|
21
|
+
gradeLevels?: EduResourcesGradeLevel[]
|
|
22
|
+
time?: EduResourcesTime
|
|
23
|
+
standards?: EduResourceStandardItem[]
|
|
24
|
+
negativeTop?: boolean
|
|
25
|
+
negativeBottom?: boolean
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// define props
|
|
29
|
+
const props = withDefaults(defineProps<MetaPanelProps>(), {
|
|
30
|
+
button: undefined,
|
|
31
|
+
theme: 'primary',
|
|
32
|
+
primarySubject: undefined,
|
|
33
|
+
additionalSubjects: undefined,
|
|
34
|
+
gradeLevels: undefined,
|
|
35
|
+
time: undefined,
|
|
36
|
+
standards: undefined,
|
|
37
|
+
negativeTop: false,
|
|
38
|
+
negativeBottom: false
|
|
39
|
+
})
|
|
40
|
+
const { button, theme, primarySubject, additionalSubjects, gradeLevels, time, standards } =
|
|
41
|
+
reactive(props)
|
|
42
|
+
|
|
43
|
+
const metaPanelOpen = ref(false)
|
|
44
|
+
|
|
45
|
+
const handleMetaPanel = () => {
|
|
46
|
+
metaPanelOpen.value = !metaPanelOpen.value
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const buttonText = computed(() => {
|
|
50
|
+
let text = button
|
|
51
|
+
if (text) {
|
|
52
|
+
if (metaPanelOpen.value) {
|
|
53
|
+
text = text.replace('View', 'Hide')
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return text
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
const backgroundClass = computed(() => {
|
|
60
|
+
let classes = 'bg-gray-light'
|
|
61
|
+
if (theme === 'stars') {
|
|
62
|
+
classes = 'bg-primary bg-stars bg-auto lg:bg-cover'
|
|
63
|
+
}
|
|
64
|
+
return classes
|
|
65
|
+
})
|
|
66
|
+
const headingClass = computed(() => {
|
|
67
|
+
let classes = 'text-primary'
|
|
68
|
+
if (theme === 'secondary') {
|
|
69
|
+
classes = 'text-secondary'
|
|
70
|
+
}
|
|
71
|
+
return classes
|
|
72
|
+
})
|
|
73
|
+
const borderClass = computed(() => {
|
|
74
|
+
let classes = 'border-t border-gray-light-mid'
|
|
75
|
+
if (theme === 'stars') {
|
|
76
|
+
classes = ''
|
|
77
|
+
}
|
|
78
|
+
return classes
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
interface SortedStandards {
|
|
82
|
+
[key: string]: EduResourceStandardItem[]
|
|
83
|
+
}
|
|
84
|
+
const sortedStandards = computed((): SortedStandards | undefined => {
|
|
85
|
+
if (standards) {
|
|
86
|
+
const sorted = standards.reduce<SortedStandards>((acc, item) => {
|
|
87
|
+
const type = item.standard.type
|
|
88
|
+
// Initialize array for type if it doesn't exist
|
|
89
|
+
if (!acc[type]) {
|
|
90
|
+
acc[type] = []
|
|
91
|
+
}
|
|
92
|
+
// Add item to the appropriate type array
|
|
93
|
+
acc[type].push(item)
|
|
94
|
+
return acc
|
|
95
|
+
}, {})
|
|
96
|
+
return sorted
|
|
97
|
+
}
|
|
98
|
+
return undefined
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
const standardsEla = computed(() => {
|
|
102
|
+
return sortedStandards.value ? sortedStandards.value['ccss_english_language_arts'] : undefined
|
|
103
|
+
})
|
|
104
|
+
const standardsMath = computed(() => {
|
|
105
|
+
return sortedStandards.value ? sortedStandards.value['ccss_math'] : undefined
|
|
106
|
+
})
|
|
107
|
+
const standardsNgss = computed(() => {
|
|
108
|
+
return sortedStandards.value ? sortedStandards.value['ngss'] : undefined
|
|
109
|
+
})
|
|
110
|
+
const standardsIste = computed(() => {
|
|
111
|
+
return sortedStandards.value ? sortedStandards.value['iste'] : undefined
|
|
112
|
+
})
|
|
113
|
+
</script>
|
|
114
|
+
|
|
115
|
+
<template>
|
|
116
|
+
<section
|
|
117
|
+
aria-label="Metadata"
|
|
118
|
+
class="MetaPanel z-20 relative overflow-hidden"
|
|
119
|
+
:class="{
|
|
120
|
+
'-mt-14': negativeTop,
|
|
121
|
+
'-mb-14': negativeBottom
|
|
122
|
+
}"
|
|
123
|
+
>
|
|
124
|
+
<div class="MixedBleedGrid pl-4 lg:pl-0">
|
|
125
|
+
<div
|
|
126
|
+
class="col-start-container lg:col-start-indent-col-2 col-end-bleed lg:grid grid-cols-subgrid"
|
|
127
|
+
:class="backgroundClass"
|
|
128
|
+
>
|
|
129
|
+
<div class="is-this-needed col-start-container lg:col-start-indent-col-2 col-end-container">
|
|
130
|
+
<div class="MetaPanel-heading lg:grid grid-cols-12 col-end-container container">
|
|
131
|
+
<div class="col-start-1 col-end-10 xl:col-end-9 pl-4 lg:pl-10 pr-2 py-6 lg:py-10">
|
|
132
|
+
<MetaPanelItems
|
|
133
|
+
:theme="theme"
|
|
134
|
+
:primary-subject="primarySubject"
|
|
135
|
+
:additional-subjects="additionalSubjects"
|
|
136
|
+
:grade-levels="gradeLevels"
|
|
137
|
+
:time="time"
|
|
138
|
+
/>
|
|
139
|
+
</div>
|
|
140
|
+
<div
|
|
141
|
+
v-if="button"
|
|
142
|
+
class="ThemeVariantLight col-start-10 col-end-13 pl-4 pt-4 pb-6 lg:py-10 lg:text-right"
|
|
143
|
+
>
|
|
144
|
+
<BaseButton
|
|
145
|
+
variant="secondary"
|
|
146
|
+
class="MetaPanel-button"
|
|
147
|
+
:aria-expanded="metaPanelOpen"
|
|
148
|
+
compact
|
|
149
|
+
@click="handleMetaPanel"
|
|
150
|
+
>
|
|
151
|
+
{{ buttonText }}
|
|
152
|
+
<template #icon>
|
|
153
|
+
<IconPlus
|
|
154
|
+
v-if="!metaPanelOpen"
|
|
155
|
+
class="text-xs ml-2"
|
|
156
|
+
/>
|
|
157
|
+
<IconMinus
|
|
158
|
+
v-else
|
|
159
|
+
class="text-xs ml-2"
|
|
160
|
+
/>
|
|
161
|
+
</template>
|
|
162
|
+
</BaseButton>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
<div
|
|
167
|
+
v-if="standards"
|
|
168
|
+
v-show="metaPanelOpen"
|
|
169
|
+
class="MetaPanel-panel col-start-container lg:col-start-indent-col-2 col-end-bleed lg:grid grid-cols-subgrid bg-gray-light pb-3 lg:pb-6"
|
|
170
|
+
>
|
|
171
|
+
<div
|
|
172
|
+
class="container col-start-container lg:col-start-indent-col-2 col-end-container px-8 lg:px-[3rem] xl:px-[5.8rem]"
|
|
173
|
+
>
|
|
174
|
+
<div
|
|
175
|
+
class="pt-6 lg:pt-7"
|
|
176
|
+
:class="borderClass"
|
|
177
|
+
>
|
|
178
|
+
<div
|
|
179
|
+
class="text-subtitle mb-5"
|
|
180
|
+
:class="headingClass"
|
|
181
|
+
>
|
|
182
|
+
Standards
|
|
183
|
+
<span class="sr-only">.</span>
|
|
184
|
+
</div>
|
|
185
|
+
<div class="w-full lg:grid grid-cols-2 lg:gap-6 xl:gap-10">
|
|
186
|
+
<div v-if="standardsEla">
|
|
187
|
+
<div class="text-base font-semibold text-gray-dark mb-4">
|
|
188
|
+
English Language Arts Standards
|
|
189
|
+
</div>
|
|
190
|
+
<span class="sr-only">.</span>
|
|
191
|
+
<MetaPanelAccordion
|
|
192
|
+
:standards="standardsEla"
|
|
193
|
+
class="mb-6"
|
|
194
|
+
/>
|
|
195
|
+
</div>
|
|
196
|
+
<div v-if="standardsMath">
|
|
197
|
+
<div class="text-base font-semibold text-gray-dark mb-4">
|
|
198
|
+
Common Core State Standards For Math
|
|
199
|
+
</div>
|
|
200
|
+
<span class="sr-only">.</span>
|
|
201
|
+
<MetaPanelAccordion
|
|
202
|
+
:standards="standardsMath"
|
|
203
|
+
class="mb-6"
|
|
204
|
+
/>
|
|
205
|
+
</div>
|
|
206
|
+
<div v-if="standardsNgss">
|
|
207
|
+
<div class="text-base font-semibold text-gray-dark mb-4">
|
|
208
|
+
Next Generation Science Standards
|
|
209
|
+
</div>
|
|
210
|
+
<span class="sr-only">.</span>
|
|
211
|
+
<MetaPanelAccordion
|
|
212
|
+
:standards="standardsNgss"
|
|
213
|
+
class="mb-6"
|
|
214
|
+
/>
|
|
215
|
+
</div>
|
|
216
|
+
<div v-if="standardsIste">
|
|
217
|
+
<div class="text-base font-semibold text-gray-dark mb-4">
|
|
218
|
+
Technology Standards (ISTE)
|
|
219
|
+
</div>
|
|
220
|
+
<span class="sr-only">.</span>
|
|
221
|
+
<MetaPanelAccordion :standards="standardsIste" />
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
</section>
|
|
230
|
+
</template>
|
|
231
|
+
<style lang="scss">
|
|
232
|
+
.MetaPanel {
|
|
233
|
+
.MetaPanel-button {
|
|
234
|
+
@apply border-[1px] font-primary normal-case tracking-normal font-bold text-lg py-2 bg-white;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
</style>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { reactive } from 'vue'
|
|
3
|
+
import type { AccordionItemObject, EduResourceStandardItem } from './../../interfaces'
|
|
4
|
+
import BaseAccordionItem from './../BaseAccordionItem/BaseAccordionItem.vue'
|
|
5
|
+
|
|
6
|
+
interface MetaPanelAccordionProps {
|
|
7
|
+
standards?: EduResourceStandardItem[]
|
|
8
|
+
}
|
|
9
|
+
const props = withDefaults(defineProps<MetaPanelAccordionProps>(), {
|
|
10
|
+
standards: undefined
|
|
11
|
+
})
|
|
12
|
+
const { standards } = reactive(props)
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<div class="MetaPanelAccordion">
|
|
17
|
+
<BaseAccordionItem
|
|
18
|
+
v-for="(item, index) in standards"
|
|
19
|
+
:key="index"
|
|
20
|
+
heading-level="h3"
|
|
21
|
+
class="mb-2 bg-white"
|
|
22
|
+
:item="item.standard as AccordionItemObject"
|
|
23
|
+
>
|
|
24
|
+
<template #heading>
|
|
25
|
+
<div class="w-full text-left pr-5">
|
|
26
|
+
<div class="text-sm tracking-normal text-action mb-0 can-hover:group-hover:underline">
|
|
27
|
+
{{ item.standard.domain?.domain }}
|
|
28
|
+
</div>
|
|
29
|
+
<div class="text-sm text-gray-mid-dark font-normal tracking-normal">
|
|
30
|
+
{{ item.standard.code }}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
<template #panelContents>
|
|
35
|
+
<div class="pl-3 pb-3 pr-8 text-sm text-gray-dark">
|
|
36
|
+
<p>{{ item.standard.definition }}</p>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
</BaseAccordionItem>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
<style lang="scss">
|
|
43
|
+
.MetaPanelAccordion {
|
|
44
|
+
.BaseAccordionItem {
|
|
45
|
+
.BaseAccordionHeader {
|
|
46
|
+
@apply bg-white;
|
|
47
|
+
> div {
|
|
48
|
+
@apply border-none;
|
|
49
|
+
}
|
|
50
|
+
button.BaseAccordion-trigger {
|
|
51
|
+
@apply py-2 px-3;
|
|
52
|
+
@apply can-hover:hover:no-underline;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
&.-open {
|
|
56
|
+
.BaseAccordionHeader {
|
|
57
|
+
button.BaseAccordion-trigger {
|
|
58
|
+
@apply pb-0;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import MetaPanelItems from './MetaPanelItems.vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/Utilities/MetaPanelItems',
|
|
5
|
+
component: MetaPanelItems,
|
|
6
|
+
tags: ['!autodocs']
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// stories
|
|
10
|
+
export const BaseStory = {
|
|
11
|
+
name: 'MetaPanelItems',
|
|
12
|
+
args: {
|
|
13
|
+
primarySubject: { subject: 'Math' },
|
|
14
|
+
additionalSubjects: [{ subject: 'Science' }],
|
|
15
|
+
time: { time: '30mins - hr' },
|
|
16
|
+
gradeLevels: [
|
|
17
|
+
{ gradeLevel: 'All Ages' },
|
|
18
|
+
{ gradeLevel: 'K' },
|
|
19
|
+
{ gradeLevel: '1' },
|
|
20
|
+
{ gradeLevel: '2' },
|
|
21
|
+
{ gradeLevel: '5' },
|
|
22
|
+
{ gradeLevel: '6' },
|
|
23
|
+
{ gradeLevel: '7' },
|
|
24
|
+
{ gradeLevel: '8' }
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, reactive } from 'vue'
|
|
3
|
+
import { rangeifyGrades } from './../../utils/rangeifyGrades'
|
|
4
|
+
import {
|
|
5
|
+
MetaPanelTheme,
|
|
6
|
+
EduResourcesSubject,
|
|
7
|
+
EduResourcesGradeLevel,
|
|
8
|
+
EduResourcesTime
|
|
9
|
+
} from './../../interfaces'
|
|
10
|
+
import IconSubject from './../Icons/IconSubject.vue'
|
|
11
|
+
import IconProfile from './../Icons/IconProfile.vue'
|
|
12
|
+
import IconTime from './../Icons/IconTime.vue'
|
|
13
|
+
|
|
14
|
+
interface MetaPanelProps {
|
|
15
|
+
theme?: MetaPanelTheme
|
|
16
|
+
primarySubject: EduResourcesSubject
|
|
17
|
+
additionalSubjects?: EduResourcesSubject[]
|
|
18
|
+
gradeLevels?: EduResourcesGradeLevel[]
|
|
19
|
+
time?: EduResourcesTime
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// define props
|
|
23
|
+
const props = withDefaults(defineProps<MetaPanelProps>(), {
|
|
24
|
+
theme: 'primary',
|
|
25
|
+
primarySubject: undefined,
|
|
26
|
+
additionalSubjects: undefined,
|
|
27
|
+
gradeLevels: undefined,
|
|
28
|
+
time: undefined
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const { theme, primarySubject, additionalSubjects, gradeLevels, time } = reactive(props)
|
|
32
|
+
|
|
33
|
+
const audience = computed(() => {
|
|
34
|
+
return gradeLevels ? rangeifyGrades(gradeLevels) : undefined
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const subjects = computed(() => {
|
|
38
|
+
let combinedArray = [primarySubject.subject]
|
|
39
|
+
let output = undefined
|
|
40
|
+
if (additionalSubjects) {
|
|
41
|
+
const filteredArray = additionalSubjects.map((item) => item.subject)
|
|
42
|
+
combinedArray = combinedArray.concat(filteredArray)
|
|
43
|
+
}
|
|
44
|
+
output = combinedArray.join(', ')
|
|
45
|
+
return output
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const iconColor = computed(() => {
|
|
49
|
+
let classes = 'text-primary'
|
|
50
|
+
if (theme === 'secondary') {
|
|
51
|
+
classes = 'text-secondary'
|
|
52
|
+
} else if (theme === 'stars') {
|
|
53
|
+
classes = 'text-white'
|
|
54
|
+
}
|
|
55
|
+
return classes
|
|
56
|
+
})
|
|
57
|
+
const headingColor = computed(() => {
|
|
58
|
+
let classes = 'text-primary'
|
|
59
|
+
if (theme === 'secondary') {
|
|
60
|
+
classes = 'text-secondary'
|
|
61
|
+
} else if (theme === 'stars') {
|
|
62
|
+
classes = 'text-white opacity-60'
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return classes
|
|
66
|
+
})
|
|
67
|
+
const textColor = computed(() => {
|
|
68
|
+
let classes = 'text-gray-dark'
|
|
69
|
+
if (theme === 'stars') {
|
|
70
|
+
classes = 'text-white'
|
|
71
|
+
}
|
|
72
|
+
return classes
|
|
73
|
+
})
|
|
74
|
+
const themeVariant = computed(() => {
|
|
75
|
+
let variant = 'ThemeVariantGray'
|
|
76
|
+
if (theme === 'stars') {
|
|
77
|
+
variant = 'ThemeVariantDark'
|
|
78
|
+
}
|
|
79
|
+
return variant
|
|
80
|
+
})
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<template>
|
|
84
|
+
<div
|
|
85
|
+
class="MetaPanelItems md:flex gap-10"
|
|
86
|
+
:class="{ 'justify-between': subjects && audience && time }"
|
|
87
|
+
>
|
|
88
|
+
<div
|
|
89
|
+
v-if="subjects"
|
|
90
|
+
class="MetaPanelItem"
|
|
91
|
+
>
|
|
92
|
+
<div
|
|
93
|
+
class="MetaPanelItem-icon"
|
|
94
|
+
:class="iconColor"
|
|
95
|
+
>
|
|
96
|
+
<IconSubject class="text-[2em] md:text-[2.4em]" />
|
|
97
|
+
</div>
|
|
98
|
+
<div>
|
|
99
|
+
<div
|
|
100
|
+
class="MetaPanelItem-heading"
|
|
101
|
+
:class="`${themeVariant} ${headingColor}`"
|
|
102
|
+
>
|
|
103
|
+
Subjects
|
|
104
|
+
<span class="sr-only">.</span>
|
|
105
|
+
</div>
|
|
106
|
+
<div
|
|
107
|
+
class="MetaPanelItem-content"
|
|
108
|
+
:class="textColor"
|
|
109
|
+
>
|
|
110
|
+
{{ subjects }}
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
<div
|
|
115
|
+
v-if="audience"
|
|
116
|
+
class="MetaPanelItem"
|
|
117
|
+
>
|
|
118
|
+
<div
|
|
119
|
+
class="MetaPanelItem-icon"
|
|
120
|
+
:class="iconColor"
|
|
121
|
+
>
|
|
122
|
+
<IconProfile class="text-[2.1em] md:text-[2.5em] mt-1 md:mt-0" />
|
|
123
|
+
</div>
|
|
124
|
+
<div>
|
|
125
|
+
<div
|
|
126
|
+
class="MetaPanelItem-heading"
|
|
127
|
+
:class="`${themeVariant} ${headingColor}`"
|
|
128
|
+
>
|
|
129
|
+
Grade Levels
|
|
130
|
+
<span class="sr-only">.</span>
|
|
131
|
+
</div>
|
|
132
|
+
<div
|
|
133
|
+
class="MetaPanelItem-content"
|
|
134
|
+
:class="textColor"
|
|
135
|
+
>
|
|
136
|
+
{{ audience }}
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
<div
|
|
141
|
+
v-if="time?.time"
|
|
142
|
+
class="MetaPanelItem"
|
|
143
|
+
>
|
|
144
|
+
<div
|
|
145
|
+
class="MetaPanelItem-icon"
|
|
146
|
+
:class="iconColor"
|
|
147
|
+
>
|
|
148
|
+
<IconTime class="text-[1.6em] md:text-[2em] ml-1 mt-1" />
|
|
149
|
+
</div>
|
|
150
|
+
<div>
|
|
151
|
+
<div
|
|
152
|
+
class="MetaPanelItem-heading"
|
|
153
|
+
:class="`${themeVariant} ${headingColor}`"
|
|
154
|
+
>
|
|
155
|
+
Time Required
|
|
156
|
+
<span class="sr-only">.</span>
|
|
157
|
+
</div>
|
|
158
|
+
<div
|
|
159
|
+
class="MetaPanelItem-content"
|
|
160
|
+
:class="textColor"
|
|
161
|
+
>
|
|
162
|
+
{{ time.time }}
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
</template>
|
|
168
|
+
<style lang="scss">
|
|
169
|
+
.MetaPanelItems {
|
|
170
|
+
.MetaPanelItem {
|
|
171
|
+
@apply flex w-full items-start mb-4 md:mb-0 w-auto;
|
|
172
|
+
&:last-of-type {
|
|
173
|
+
@apply mb-0;
|
|
174
|
+
}
|
|
175
|
+
.MetaPanelItem-icon {
|
|
176
|
+
@apply mr-1 w-10 md:w-12;
|
|
177
|
+
}
|
|
178
|
+
.MetaPanelItem-heading {
|
|
179
|
+
@apply text-subtitle text-base md:mb-[.2em] whitespace-nowrap;
|
|
180
|
+
}
|
|
181
|
+
.MetaPanelItem-content {
|
|
182
|
+
@apply font-primary font-bold lg:text-xl;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
</style>
|
|
@@ -7,10 +7,8 @@ export default {
|
|
|
7
7
|
argTypes: {
|
|
8
8
|
variant: {
|
|
9
9
|
type: { name: 'string', required: false },
|
|
10
|
-
control: {
|
|
11
|
-
|
|
12
|
-
options: ['primary', 'secondary']
|
|
13
|
-
}
|
|
10
|
+
control: { type: 'select' },
|
|
11
|
+
options: ['primary', 'secondary']
|
|
14
12
|
}
|
|
15
13
|
},
|
|
16
14
|
excludeStories: /.*Data$/
|
|
@@ -113,7 +113,7 @@ const MixinCarouselOptions = swiperOptions.MixinCarousel
|
|
|
113
113
|
Swiper.use([Navigation, A11y])
|
|
114
114
|
|
|
115
115
|
interface Variants {
|
|
116
|
-
[
|
|
116
|
+
[key: string]: string
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
export const variants: Variants = {
|
|
@@ -122,7 +122,7 @@ export const variants: Variants = {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
interface Indents {
|
|
125
|
-
[
|
|
125
|
+
[key: string]: string
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
export const indents: Indents = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<NavSecondary
|
|
3
3
|
v-if="enabled"
|
|
4
|
-
id="
|
|
4
|
+
id="NavJumpMenu"
|
|
5
5
|
ref="NavJumpMenuRef"
|
|
6
6
|
class="NavJumpMenu -hide-until-threshold"
|
|
7
7
|
:invert="invert"
|
|
@@ -78,11 +78,11 @@ const theJumpLinks = computed(() => {
|
|
|
78
78
|
return b.blockType === 'HeadingBlock' && b.level === props.headingLevel
|
|
79
79
|
})
|
|
80
80
|
// map to the correct data shape
|
|
81
|
-
const links: BreadcrumbPathObject[] = filteredBlocks.map((
|
|
81
|
+
const links: BreadcrumbPathObject[] = filteredBlocks.map((h) => {
|
|
82
82
|
return {
|
|
83
83
|
// @ts-expect-error using parameter that was added to BlockData
|
|
84
|
-
path: '#' + getHeadingId(
|
|
85
|
-
title:
|
|
84
|
+
path: '#' + getHeadingId(h.heading, h.blockId),
|
|
85
|
+
title: h.heading
|
|
86
86
|
} as BreadcrumbPathObject
|
|
87
87
|
})
|
|
88
88
|
return links
|
|
@@ -95,11 +95,11 @@ const theBreadcrumbs = computed(() => {
|
|
|
95
95
|
const rootItem = props.title
|
|
96
96
|
? {
|
|
97
97
|
title: props.title,
|
|
98
|
-
path: '#
|
|
98
|
+
path: '#siteTop'
|
|
99
99
|
}
|
|
100
100
|
: {
|
|
101
101
|
title: 'Back to top',
|
|
102
|
-
path: '#
|
|
102
|
+
path: '#siteTop'
|
|
103
103
|
}
|
|
104
104
|
const jumpMenu: BreadcrumbPathObject = {
|
|
105
105
|
title: 'Jump to…',
|
|
@@ -111,12 +111,14 @@ const theBreadcrumbs = computed(() => {
|
|
|
111
111
|
}
|
|
112
112
|
return breadcrumb as BreadcrumbPathObject[] | undefined
|
|
113
113
|
})
|
|
114
|
+
|
|
114
115
|
defineExpose({
|
|
115
116
|
NavJumpMenuRef
|
|
116
117
|
})
|
|
117
118
|
onMounted(() => {
|
|
118
119
|
mixinUpdateSecondary(theBreadcrumbs.value, true)
|
|
119
120
|
})
|
|
121
|
+
|
|
120
122
|
const route = useRoute()
|
|
121
123
|
|
|
122
124
|
// repopulate the store with the jump links since the store is cleared on route changes
|
|
@@ -131,10 +133,10 @@ watch(
|
|
|
131
133
|
<style lang="scss">
|
|
132
134
|
.NavJumpMenu {
|
|
133
135
|
&.-hide-until-threshold {
|
|
134
|
-
@apply opacity-0 h-0 transition-none overflow-visible;
|
|
136
|
+
@apply opacity-0 h-0 transition-none overflow-visible pointer-events-none;
|
|
135
137
|
&.-is-sticky,
|
|
136
138
|
&.-is-sticky-offset {
|
|
137
|
-
@apply opacity-100 transition-
|
|
139
|
+
@apply opacity-100 transition-all pointer-events-auto;
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
142
|
}
|
|
@@ -81,9 +81,17 @@ export default defineComponent({
|
|
|
81
81
|
default: false
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
|
-
data() {
|
|
84
|
+
data(): {
|
|
85
|
+
isSticky: boolean
|
|
86
|
+
stickyElement?: HTMLElement
|
|
87
|
+
observer?: IntersectionObserver
|
|
88
|
+
observerOffset?: IntersectionObserver
|
|
89
|
+
} {
|
|
85
90
|
return {
|
|
86
|
-
isSticky: false
|
|
91
|
+
isSticky: false,
|
|
92
|
+
stickyElement: undefined,
|
|
93
|
+
observer: undefined,
|
|
94
|
+
observerOffset: undefined
|
|
87
95
|
}
|
|
88
96
|
},
|
|
89
97
|
computed: {
|
|
@@ -119,6 +127,7 @@ export default defineComponent({
|
|
|
119
127
|
) {
|
|
120
128
|
// intersection observer not supported
|
|
121
129
|
} else if (this.enabled) {
|
|
130
|
+
this.initIntersectionObservers()
|
|
122
131
|
this.checkSticky()
|
|
123
132
|
}
|
|
124
133
|
},
|
|
@@ -129,29 +138,31 @@ export default defineComponent({
|
|
|
129
138
|
}
|
|
130
139
|
return false
|
|
131
140
|
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const observer = new IntersectionObserver(
|
|
141
|
+
initIntersectionObservers() {
|
|
142
|
+
this.stickyElement = this.$refs.NavSecondary as HTMLElement
|
|
143
|
+
this.observer = new IntersectionObserver(
|
|
136
144
|
([e]) => {
|
|
137
|
-
e.target.classList.toggle('-is-sticky', e.intersectionRatio
|
|
145
|
+
e.target.classList.toggle('-is-sticky', e.intersectionRatio === 0)
|
|
138
146
|
},
|
|
139
147
|
{
|
|
140
|
-
threshold: [
|
|
148
|
+
threshold: [0]
|
|
141
149
|
}
|
|
142
150
|
)
|
|
143
|
-
|
|
151
|
+
this.observerOffset = new IntersectionObserver(
|
|
144
152
|
([e]) => {
|
|
145
|
-
e.target.classList.toggle('-is-sticky-offset', e.intersectionRatio
|
|
153
|
+
e.target.classList.toggle('-is-sticky-offset', e.intersectionRatio === 0)
|
|
146
154
|
},
|
|
147
155
|
{
|
|
148
|
-
threshold: [
|
|
149
|
-
|
|
150
|
-
rootMargin: '-113px 0px 0px 0px'
|
|
156
|
+
threshold: [0],
|
|
157
|
+
rootMargin: this.themeStore.isEdu ? '-73px 0px 0px 0px' : '-113px 0px 0px 0px'
|
|
151
158
|
}
|
|
152
159
|
)
|
|
153
|
-
|
|
154
|
-
|
|
160
|
+
},
|
|
161
|
+
checkSticky() {
|
|
162
|
+
if (this.stickyElement) {
|
|
163
|
+
if (this.observer) this.observer.observe(this.stickyElement)
|
|
164
|
+
if (this.observerOffset) this.observerOffset.observe(this.stickyElement)
|
|
165
|
+
}
|
|
155
166
|
}
|
|
156
167
|
}
|
|
157
168
|
})
|
|
@@ -89,7 +89,7 @@ const buttonClass = computed(() => {
|
|
|
89
89
|
})
|
|
90
90
|
</script>
|
|
91
91
|
<template>
|
|
92
|
-
<div class="ShareButtonsEdu relative flex flex-row items-start border-collapse print:hidden">
|
|
92
|
+
<div class="ShareButtonsEdu relative z-30 flex flex-row items-start border-collapse print:hidden">
|
|
93
93
|
<BaseButton
|
|
94
94
|
variant="social"
|
|
95
95
|
:class="buttonClass"
|